Jump to content
  • Advertisement
Sign in to follow this  
Mercury

The character that would result from pressing shift key

This topic is 4845 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'm reading in characters, '1', 'a', etc. And I can tell when the shift key is down, but I can't find a function that will handle the characters when the shift key is down. For example, '1' should be converted to '!' on my keyboard, but I can't hardcode it because of internationalization. Does anyone know of a function that can do this for me?

Share this post


Link to post
Share on other sites
Advertisement
How are you reading your characters? Some input APIs will automagically will give you the proper translation for the shift state if you ask them nicely.

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
How are you reading your characters? Some input APIs will automagically will give you the proper translation for the shift state if you ask them nicely.

I'm reading them from SDL, and after checking over their documentation briefly I couldn't find anything that would give me the correct character.

Share this post


Link to post
Share on other sites
Try using SDL_EnableUNICODE. It should put the printable representation of the key in the unicode member of the keysym structure, or 0 for non-printing characters.

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!