Keyboard Handling

So I've run into an interesting issue. I've recently updated my game from using just KeyUp KeyDown to accepting the whole range of keys on my keyboard via keycodes.

This so far has worked our GREAT (minus a small bug dealing with flagsChanged not returning opposite events, but that's an easy fix). HOWEVER, I've run into an issue where keycodes have no earthly mapping to what's on the keyboard in any form. "wasd" on my qwerty keyboard is ",aoe" on my friend's keyboard. So how does one properly store keycode and still display the correct thing to the user.

Honestly, I wouldn't feel bad about being "left out". It's generally easier to switch the keyboard layout before playing a game than to reconfigure keys so I'm quite used to it. It's the games that require typing/chatting AND don't allow the keys to be reconfigured that are killer.

This seemed to mostly work except:
Caplocks showed up as Key #57
NumLock/Clear showed up as Key #71
Some other key on my keyboard that I don't know what it was showed up as another strange Key #098
No distinction between 1-0 and keypad 1-0,

For CapLock:
According to the function UCKeyTranslate returned with err equal to noErr, however "actualStringLength" was equal to 0, but the buffer had this in it:
[0] 19320
[1] 37395
[2] 0
misc...

my temp fix for this was just adding those keys to the fallback table. Though I'm concerned about spacebar showing up as blank instead of "Space". Just hacked that so that keycode 49 always returns "Space"

Github is really great. Git is pretty neat too. Well worth learning how to use both. Essentially all open development worth a damn is happening on Github these days, and participation is vastly easier than SourceForge.

Quote:b) whether there's a way to get modifier key changes via keyUp: and keyDown: