Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

[SDL] How to handle keyboard text input?

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
2 replies to this topic

#1 SeeForever   Members   

131
Like
0Likes
Like

Posted 31 January 2012 - 02:08 PM

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!

#2 Jakez   Members   

103
Like
1Likes
Like

Posted 31 January 2012 - 02:36 PM

have you seen this? :)

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

#3 SeeForever   Members   

131
Like
0Likes
Like

Posted 01 February 2012 - 05:11 AM

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! Posted Image




Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.