• Advertisement
Sign in to follow this  

c++ how to detect Enter button input

This topic is 1128 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 have been trying to detect enter button and arrow keys and failing realy hard if some one could give me a source to detect arrow and enter key i would be realy greatful

Share this post


Link to post
Share on other sites
Advertisement

Since you are on windows try looking at using the windows.h file and google GetAsyncKeyState should be all you need to figure it out.

Share this post


Link to post
Share on other sites

For console apps look up stdio.h, iostream, and friends.

 

For windowed apps, look up GetAsyncKeyState and WM_KEYDOWN/WM_KEYUP.

 

You probably want to abstract windowed mode input anyway as it a bit of a minefield to do properly. Search this forum for tons of advice using those keywords above...

 

Good luck!

Share this post


Link to post
Share on other sites
and no i didnt get sfml to work i dont know what's the matter but ill try to post a picture

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement