Sign in to follow this  
Followers 0
Thatsgreat2345

Keypresses With C/c++

5 posts in this topic

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?

Share this post


Link to post
Share on other sites



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.

Share this post


Link to post
Share on other sites

Check out the keybd_event() API. Pretty sure this is what you need.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

yeah cuz i tryed the button.h stuff , and it was detected by the game i was playing so maybe sendinput will work :)

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  
Followers 0