[SDL] SDL 1.3: UTF-8 vs UTF-16 vs UTF-32?

Christian Walther cwalther at gmx.ch
Sat Feb 4 11:18:56 PST 2006


Gerry JJ wrote:
> It would be nice if there was position-based keysyms as well.

I strongly agree with Gerry's arguments. Here's what I wrote about it 
previously: <http://article.gmane.org/gmane.comp.lib.sdl/24697>

Sam Lantinga wrote:
 > Aside from scancode, which is keyboard vendor specific, I don't think
 > there's a portable way to do this.  Does anyone know differently?

Just make up SDL's own set of codes, and have each backend 
implementation map from its OS or hardware dependent scancodes to that 
set? If that's not possible on some OSes, they can still fall back to 
mapping-by-character.

It's easy to do on Mac OS X. It's already done on DirectX. On X11, it's 
a bit more complex - it seems that X-server- and/or hardware-specific 
look-up tables would be needed, but this could still be done for the 
most common cases (XFree86/Xorg on PC and Mac hardware, at least), with 
a graceful fallback to mapping-by-character on other systems.

Brian Raiter wrote:
 > I can at any time replace my qwerty keyboard with a dvorak keyboard,
 > or even a chording keyboard with a total of seven keys, without having
 > to reconfigure or even notify the operating system.

On what OS and hardware is that? I have never seen a system where the OS 
does not need to be told what's printed on your keycaps. Or does your 
Dvorak keyboard actually move the keys around compared to the Qwerty 
keyboard, instead of just relabeling them? If so, I don't think that's 
the norm. My US keyboard has the keys in the same places as my Swiss 
German one (mostly), they're just labeled differently.

  -Christian





More information about the SDL mailing list