Advertisement Jump to content
Sign in to follow this  
LostAgain

[.net] Simulate Keypress and Directx

This topic is 4477 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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!