Jump to content
  • Advertisement
Sign in to follow this  
Esgaroth

sending key press with sendinput()

This topic is 4491 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 need help sending an escape key press to whatever window has focus. Ive had success sending other key presses but im having trouble with escape. I have a window that is suposed to close when escape is pressed. here is the code im using. INPUT key; key.type = INPUT_KEYBOARD; key.ki.wVk = VK_ESCAPE; key.ki.dwFlags = 0; key.ki.time = 0; key.ki.wScan = 0; key.ki.dwExtraInfo = 0; SendInput( 1, &key, sizeof(key) ); Im pretty sure that the code is fine so why wont the window respond to the sendinput() but it will respond if i press the escape key?

Share this post


Link to post
Share on other sites
Advertisement
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!