sebastiannielsen
Programmer
Im trying to send keyevents to my server:
but when im testing in notepad, the current date are pasted when i enter the word "test" in the variable $kbd.
This means the keybd_event is pressing the F5 key.
I want the keybd_event to type the text in the $kbd variable.
Code:
$sendkbd = Win32::API->new('user32.dll', 'keybd_event', 'NNNN', 'V');
if ($kbd) {
@dta = split("",$kbd);
foreach $k (@dta) {
$e = ord($k);
$sendkbd->Call($e, 0, 0, 0);
$sendkbd->Call($e, 0, 2, 0);
}
}
but when im testing in notepad, the current date are pasted when i enter the word "test" in the variable $kbd.
This means the keybd_event is pressing the F5 key.
I want the keybd_event to type the text in the $kbd variable.