[SDL] Reading text from keyboard
toytoy at gmx.ch
Fri Jan 17 11:22:00 PST 2003
Thanks for your tip, I will try to use unicode.
Von: sdl-admin at libsdl.org [mailto:sdl-admin at libsdl.org] Im Auftrag von David
Gesendet: Freitag, 17. Januar 2003 18:46
An: sdl at libsdl.org
Betreff: Re: [SDL] Reading text from keyboard
On Friday 17 January 2003 15.20, toytoy at gmx.ch wrote:
> I'm looking for a comfortable possibility to read text from the
> keyboard. At the Moment I'm checking for a lot key combinations for
> special characters, but that's really bad, specially because I got a
> swiss keyboard... Is there a better way to do this job, I already
> tried the SDL input events but it seems they also don't give you key
> combinations (like shift+1, ...).
They sure do, but *all* physical keys are treated as such, regardless
of keymaps and stuff. Think of the keyboard as a gigantic gamepad. :-)
As to your problem, you're *not* supposed to do this yourself in an
application, ever. That won't work with different layouts (like
Dvorak... *heh*), and it hardcodes your application to a specific
language for no good reason.
Doesn't UNICODE provide the information you need?
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. | RT and
| off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
--- http://olofson.net --- http://www.reologica.se ---
SDL mailing list
SDL at libsdl.org
More information about the SDL