I think that in Win32::GUI there is a bug.
When you start the code attached at the end of the mail then you can see
that:
1. key F10 does not work. The same is in WinXP and in Win98.
2. When I did similar program for Win32-Console package it work correctly.
3. The F10 key behavior is funny: it works as a switcher for other Fxx
keys but not for other keys.
When I press the F10 key 1,3,... (odd number) times then other Fxx keys
don't work.
I use Perl 5.8.817 - Activestate, Win32-GUI 1.05
I've checked it also with 1.03 version of Win32-GUI - the same result
-----------
It could seem that it is not important problem. In the case of WinXP the
problem is not big in fact.
Only F10 doesn't work and application works smoothly.
However on Windows98 there is quite serious problem; because the
keyboard answer
is unstable and unpredictible I am facing against the problem:
Is the problem of Windows or Perl itself?
No! Other software, like Win32-Console works properly.
Is it solution to the problem.
###############################################
#!/usr/bin/perl -w
use strict;
use warnings;
use Win32::GUI qw();
my $Window = new Win32::GUI::Window (
-name => "Window",
-pos => [0,0],
-size => [200,100],
-onTerminate => sub { return -1 },
);
$Window->AddTextfield(
-name => "Pole",
-pos => [0,0],
-size => [800,600],
-onKeyDown => \&keydown,
);
$Window->Pole->Text("Exit = Alt+F4");
$Window->Pole->SetFocus();
$Window->Show();
Win32::GUI::Dialog();
exit(1);
#-----------------------------------------
sub keydown {
my $hasz = Win32::GUI::GetKeyboardState();
for ( my $i = 0; $i < 256; $i++ ) { print $i,'|' if $hasz->[$i] }
print "\n";
return 1;
}
###############################################