Thatsgreat2345 Posted April 3, 2006 Share Posted April 3, 2006 I was wondering if anyone knew how to do a keypress with C or C++, ive been searching google and i still havent really found anything, i found a thing called button.h to include but i looked at it and i dont think i could use any of the functions, so do any one in here that knows C++ or C know how to make something do a key press? Link to comment Share on other sites More sharing options...
greenmachine Posted April 3, 2006 Share Posted April 3, 2006 Look in the source code, it's in there. Appears to be a lot of pre-send checking (special keys, etc), keyboard modification to match special keys, and then postmessage. It's in the file sendkeys.cpp if you want to look for yourself. Link to comment Share on other sites More sharing options...
Emperor Posted April 3, 2006 Share Posted April 3, 2006 Check out the keybd_event() API. Pretty sure this is what you need. Link to comment Share on other sites More sharing options...
Richard Robertson Posted April 4, 2006 Share Posted April 4, 2006 If you are using an updated SDK, the help file will direct you to SendInput. SendInput is a little better because it also sends mouse and hardware messages. Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted April 4, 2006 Author Share Posted April 4, 2006 yeah cuz i tryed the button.h stuff , and it was detected by the game i was playing so maybe sendinput will work Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now