Setting background colors using non-QWERTY keyboard
pylipp opened this issue · comments
The keys for switching background color are based on the QWERTY-layout:
Lines 508 to 525 in cd04928
For me (QWERTZ-user), the corresponding row is !"§$%&/()
. Is it easy to detect the actual ID of the key being pressed rather than the symbol mapped to it? Expanding the current mapping does not make sense because f.i. (
is on the German 8 but on the English 9.
Anyways, not a big deal because I probably won't be switching colors all day long.
Interesting, hadn't thought about that. Let me look into it!
Well, looks like an easy fix would be to add the three characters " § / as alternatives, since they're not used anyway. This would help for French Canadian keyboards as well!
Looking at the differences more closely, this won't work. Also, it seems that curses can only see the final output of SHIFT combinations. How about 'g' to cycle though background colors (and 'f' for foreground colors.) Then people around the word can switch background colors all day long!
OR... the ALT key would work.
For example, Alt-1 and Alt-2 look like '1[' and '2[' to the curses 'get character' function. These would map correctly on any keyboard. The only problem is that people might have these combinations already set to do something in their window manager or terminal...
These are some valuable thoughts! I like the g/f cycling option very much (I think few remember what key maps to whichever color anyways). And using the Alt key might indeed interfer with some peoples workflow (I think gnome-terminal uses Alt-; people could have it as their WM modifier etc...)
Maybe use c/C key for cycling however, because f toggles flashers? Do you want me to do a PR?