Re: Keyboard handler

2011-09-01 Thread Angelos Karageorgiou
On 1/9/2011 7:32 μμ, Barry Brevik wrote:
> This is a bit of a selfish post, but since list traffic is low right
> now, here goes.
>  
> I'm developing a routine that essentially loops looking for keyboard
> input. If it has any, it processes the key otherwise it performs some
> other (short) processes and loops around again to check for keyboard
> input.
>  
> I've been writing a routine that uses Win32::Console in the manner shown
> below.
>
> Anyway, writing this has become way complex, and I've lost my way. I'm
> wondering if anyone out there has some example code that they would be
> willing to share?
>
>

coliau.codeplex.com it has a keyboard handling thread
Have fun



signature.asc
Description: OpenPGP digital signature
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Keyboard handler

2011-09-01 Thread Barry Brevik
This is a bit of a selfish post, but since list traffic is low right
now, here goes.
 
I'm developing a routine that essentially loops looking for keyboard
input. If it has any, it processes the key otherwise it performs some
other (short) processes and loops around again to check for keyboard
input.
 
I've been writing a routine that uses Win32::Console in the manner shown
below.

Anyway, writing this has become way complex, and I've lost my way. I'm
wondering if anyone out there has some example code that they would be
willing to share?

Barry Brevik
=
my $STDIN = new Win32::Console(STD_INPUT_HANDLE);
$STDIN->Mode(ENABLE_PROCESSED_INPUT);
 
while (1)
{
  # Read keyboard event.
  my @input = $STDIN->Input();
  if (defined $input[0] and $input[0] == 1)
  {

  }

  
}

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs