Jump to content
Sign in to follow this  
Thatsgreat2345

Keypresses With C/c++

Recommended Posts

Thatsgreat2345

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
greenmachine

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
Emperor

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

Share this post


Link to post
Share on other sites
Richard Robertson

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
Thatsgreat2345

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.