Snake Sneak
Posts: 106
Joined: Sunday, 1st January 2012, 01:28
ALT key
It appears that ALT key combinations in the SDL port use the range -3000 to -2000. Is this intentional?
In particular, _translate_keysym() in windowmanager-sdl.cc has a comment
but later uses
This seems unintentional, and it causes a real problem when trying to map these keys. key_to_command() seems to interpret numbers in this range specially, so normal maps (via cmd-keys.h) don't work.
Take ALT-j for example. To find the code, open the game and press ~, m, <ALT-j>; this prints out \{-2894}. However, when you actually press ALT-j in the game, it prints out the following error message:
key_to_command(): command 'CMD_NO_CMD' (894:185) wrong for desired context
Adding mappings in cmd-keys.h doesn't help, because it never gets that far since it first takes the
branch.
In particular, _translate_keysym() in windowmanager-sdl.cc has a comment
but later uses
This seems unintentional, and it causes a real problem when trying to map these keys. key_to_command() seems to interpret numbers in this range specially, so normal maps (via cmd-keys.h) don't work.
Take ALT-j for example. To find the code, open the game and press ~, m, <ALT-j>; this prints out \{-2894}. However, when you actually press ALT-j in the game, it prints out the following error message:
key_to_command(): command 'CMD_NO_CMD' (894:185) wrong for desired context
Adding mappings in cmd-keys.h doesn't help, because it never gets that far since it first takes the
branch.