• Advertisement
Sign in to follow this  

[.net] Simulate Keypress and Directx

This topic is 4149 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to write a program that will send a keypress to ANOTHER application (and eventually i will do a mouse move / press also). i tried using the managed sendinput and while it works in normal applications it does NOT work in Directx applications. any suggestions? i am trying to figure out the pinvoke version of SenInput but having very little luck at the moment so if you happen to know what to do in order to get this to work please help.

Share this post


Link to post
Share on other sites
Advertisement
DirectX apps (by which I presume you mean 'games') typically query the keyboard state directly, not by responding to WM_KEY*** messages, so 'sending a keypress' won't do a lot. You need to set the keyboard state, and I don't know if that's possible. Look up GetAsyncKeyState (Win32 SDK) and see if it has a corresponding set method.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement