[SDL] Arrow Keys, and keysym.unicode, SDL 1.2.10

Christian Walther cwalther at gmx.ch
Sun Jun 25 02:56:16 PDT 2006


Nigel Kerr wrote:
> If I start this modified app, and then press on keyboard of my laptop
> the left arrow, then the up, then right, then down, I get the
> following output:
> 
> keydown: f702 276
> keyup: f702 276
> keydown: f700 273
> keyup: f700 273
> keydown: f703 275
> keyup: f703 275
> keydown: f701 274
> keyup: f701 274
> 
> That the .sym field corresponds to the SDLK_LEFT, UP, RIGHT, and DOWN
> is fine, but what puzzles me greatly are the Unicode values.  These
> are private use area values (), and I am unsure what they mean.  I am
> not sure who is giving me these values (Macosx?  SDL?); have I missed
> in the documentation or mailing list what is intended?

These values come from Mac OS X. Apparently Apple (or NeXT before them) 
decided that the arrow keys should generate character codes too.

See <http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/CORPCHAR.TXT> 
(or other pages reached from <http://www.google.com/search?q=U%2BF700>).

As far as I know the SDL documentation does not specify that 
non-character-keys should not generate Unicode values, so the observed 
behavior of the Mac OS X (Quartz/Cocoa) backend seems to be OK.

> So maybe I'm asking for advice: should I try to handle the
> "command-like" non-printing characters first before anything else?

That's what I do.

I wouldn't spend too much work on this issue though, as the keyboard 
handling is supposed to be rewritten for 1.3 anyway, and who knows how 
this will work then.

  -Christian





More information about the SDL mailing list