Jump to content
  • Advertisement
Sign in to follow this  
LostAgain

[.net] Simulate Keypress and Directx

This topic is 4326 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!