Mastodon
Programmierung

Simulating a keystroke

> I know this a dumb question but how do I make the system think the user
> pressed Enter from somewhere other than the onKeypress or OnKeyDown events?

[code lang=”delphi”] {Key Down}
keybd_Event(VK_RETURN, 0, 0, 0) ;
Sleep(100);
{Key Up}
keybd_Event(VK_RETURN, 0, KEYEVENTF_KEYUP, 0);
[/code]

[tags]Delphi, System, Keyboard[/tags]

0 Kommentare zu “Simulating a keystroke

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.