[SDL] SDLKey wiki question

Albert Zeyer albert.zeyer at rwth-aachen.de
Thu Feb 14 07:58:56 PST 2008


Am Donnerstag, den 14.02.2008, 15:12 +0100 schrieb Lucas:
> >
> > With Unicode enabled you simply get the pressed key in Unicode?
> I meant 'letter' iso key :)
> 

Look at the manpage to SDL_keysym. This structure has a field unicode
where the letter is saved if you have activated Unicode-support.

You can activate it like this:
SDL_EnableUNICODE(1);

Now, if you press Shift+&, you get a keydown-event with
event->key.keysym.unicode == '1'.


> > Making it layout independent and easy to strip it to ASCII?
> Unicode to ASCII should be easy.
> 
> > Are there any examples around?
> Using unicode.
> 

What do you mean? This is probably not SDL related. In this unicode
field, there will be always the unicode number of the key. All special
keys will have a value >=128. It's an Uint16.





More information about the SDL mailing list