Hi
My intention was to use IsKeyPressed($c) to check if the user
pressed any of the keys as enumerated in a program. Then
sometime in the process, the program has to output the result
to another application using MouseMoveAbsPix and SendRawKey.
Up to this point, the application works OK.
However, when the application went back to the IsKeyPressed
part, it kept getting keypresses even if the user did not pressed
any key. Its as if the SendRawKey's output were stuck with the
IsKeypressed.
So I wrote the test script below:
When I run this test script, it works exactly as I wanted it.
It will echo to screen the chars 1-9 X and P.
No Problem thus far.
So I uncomment the SendRawKey; and now, it keeps printing
endlessly the numbers 1 to 9.
What happened? Why is the numbers 1-9 stuck with IsKeyPressed?
And at this time, even if I comment/remove the SendRawKey from this
test script, I keep getting the IsKeypressed non-stop.
What happened?
Dan
use strict;
use Time::HiRes qw(time usleep);
use Win32::GuiTest qw(IsKeyPressed GetCursorPos MouseMoveAbsPix SendMouse
SendKeys SendRawKey);
for (my $i=0; $i<10; $i++) {
# SendRawKey(ord($i),"KEYEVENTF_KEYDUP");
}
while (1) {
foreach my $c (qw|1 2 3 4 5 6 7 8 9 X P|) {
if (IsKeyPressed($c)) {
print $c,"\n";
}
}
usleep 10000;
}
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs