I want to print “a”. Instead it prints “9”. Why, and how to fix this?
use Win32::API;
$kbd_event = Win32::API->new(
"user32.dll",
"VOID keybd_event( BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD dwExtraInfo );"
);
$a = 0x61;
$kbd_event->Call( $a, 0, 0, 0 ); # press
$kbd_event->Call( $a, 0, 2, 0 ); # release
$kbd_event->Callis expecting a byte as its first argument but your argument is treated as an integer.Try