I have a C program that gets events from the keyboard just fine. However, I want to use Java to send it simulated keyboard events. I have tried two approaches:
Both the above approaches will do things like send keys to a text editor, etc. but the other program (GIMX to be exact) won't recognize the events. Any idea why this would be, and what I could do to get Java to communicate with it?
See here for a related discussion:
http://social.msdn.microsoft.com/forums/en-US/netfxbcl/thread/29cf2de9-412e-44dd-9050-174089d8e2a2/
Essentially, it looks like you need to send low-level SendInput
events, i.e. scan codes to work with DirectInput. To use scan codes, pass KEYEVENTF_SCANCODE
in your KBDINPUT
structure and pass the scan code in wScan
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With