curses: Fix control-{@[\]^_} and ESC
control-{@[\]^_} shouldn't get the 'a' - 'A' offset for correct translation. ESC is better simulated as escape key. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org> Signed-off-by: Andrew Zaborowski <balrogg@gmail.com>
This commit is contained in:
parent
633aa0acfe
commit
d03703c81a
@ -238,9 +238,12 @@ static void curses_refresh(DisplayState *ds)
|
||||
keysym = curses2keysym[chr];
|
||||
|
||||
if (keysym == -1) {
|
||||
if (chr < ' ')
|
||||
keysym = (chr + '@' - 'A' + 'a') | KEYSYM_CNTRL;
|
||||
else
|
||||
if (chr < ' ') {
|
||||
keysym = chr + '@';
|
||||
if (keysym >= 'A' && keysym <= 'Z')
|
||||
keysym += 'a' - 'A';
|
||||
keysym |= KEYSYM_CNTRL;
|
||||
} else
|
||||
keysym = chr;
|
||||
}
|
||||
|
||||
|
@ -55,6 +55,7 @@ static const int curses2keysym[CURSES_KEYS] = {
|
||||
[0x7f] = KEY_BACKSPACE,
|
||||
['\r'] = KEY_ENTER,
|
||||
['\n'] = KEY_ENTER,
|
||||
[27] = 27,
|
||||
[KEY_BTAB] = '\t' | KEYSYM_SHIFT,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user