• Advertisement
Sign in to follow this  

[SDL] How to handle keyboard text input?

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

Hello everyone! :)

I have a GUI in a game I'm developing. I have two text input boxes. I can input text into it using SDL_KEYDOWN events but how would I go about translating the modifier keys like shift and caps lock to turn letters into capitals and numbers into symbols? I'm looking for something locale-independent. I can just check for the 'shift' key modifier and then apply it manually to whichever key was pressed but like, I would do '!' for '1', but not everyone is using an U.S. keyboard layout.

Does SDL have something built-in for this? If not, is there a cross-platform library for it? Or am I stuck calling OS-specific functions?

Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
have you seen this? :)

http://lazyfoo.net/SDL_tutorials/lesson23/index.php

Share this post


Link to post
Share on other sites
Hey I've followed the LazyFoo tutorials before! How come I missed this one? Thanks a lot Jakez, that's exactly what I was looking for! [img]http://public.gamedev.net//public/style_emoticons/default/biggrin.png[/img]

Share this post


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

  • Advertisement