Jump to content
  • Advertisement
Sign in to follow this  
Harryu

Capturing text input

This topic is 4859 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

in a game i am making, i want the user to be able to save his/her game when they want i also want them to be able to name the save file does anybody know a good method for reading a string from the users input? i could go: if(key == 'a') strcpy(tex[0], "a"); but i think there has to be a better way thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
If you're writing a windows program, you can capture the WM_CHAR message. This message will give you the exact character the user pressed, and also gives you the correct character when the shift key is pressed, which would be a pain to work out manually.

Share this post


Link to post
Share on other sites
what would the WM_CHAR message do if the key pressed was the space bar, or enter, or another key that doesn't have a constant

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!