Link to home
Start Free TrialLog in
Avatar of fizycist
fizycist

asked on

Sending keystrokes to DirectX applications.

I need a way to send keystrokes to a DirectX (3.0+) application.  I've tried Sendkeys, as well as the keybd_event API, no luck, the keystrokes never arrive.

Anyone know?
Avatar of JohnBPrice
JohnBPrice

Hmm, I would guess it is using DirectInput, from MSDN
"Microsoft DirectInput Overview
Apart from providing services for devices not supported by the Microsoft Win32 API, Microsoft DirectInput gives faster access to input data by communicating directly with the hardware drivers rather than relying on Microsoft Windows messages."
You might try using the On-Screen keyboard (Under Accessories --> Accessibility)  If you can drive it with On-Screen Keyboard, there is some way to drive it programatically.
Avatar of fizycist

ASKER

Ok, I tried on screen keyboard.  This game will accept some keystrokes from it, not all.  The keystrokes for movement are not accepted, and these are the ones I need.  I tried remapping the keys in the game, but no luck.

So can I slip keystrokes in with DirectInput?  How?

(btw this is for a neural network demonstration, the goal is to teach a NN to play this simple game (Subspace / Contiuum.  The software can already read the screen and identify objects, but simply cannot act on its decisions, arghh)
ASKER CERTIFIED SOLUTION
Avatar of JohnBPrice
JohnBPrice

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial