Sign in to follow this  
Esgaroth

sending key press with sendinput()

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this