Im using:
keybd_event(0x41, 0, 0, 0);
0x41 is a 'a'. But that just prints one 'a' to the screen. I need it to hold down the key. And when i call
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
it must release the key.
Is that possible?
Im using:
keybd_event(0x41, 0, 0, 0);
0x41 is a 'a'. But that just prints one 'a' to the screen. I need it to hold down the key. And when i call
keybd_event(0x41, 0, KEYEVENTF_KEYUP, 0);
it must release the key.
Is that possible?
What are you trying to accomplish? The keys that are intended to remain pressed should already do so with your first line.
Here's the documentation for keybd_event(). Maybe it will help answer your question. (And maybe you needed the GetKeyboardState() method?)
If you're simply trying to repeatedly strike a key, it would be easier to loop around the first call than to try to get the system to auto-repeat. You can find the proper delay to use in the system information API functions.