diff options
author | Samuel Thibault <samuel.thibault@gnu.org> | 2010-10-19 19:48:20 +0200 |
---|---|---|
committer | Andrzej Zaborowski <balrog@zabor.org> | 2010-10-21 18:31:28 +0200 |
commit | d03703c81a202cea156811e5dbc8e88627c19986 (patch) | |
tree | bc22fad9e369b7a770ebdf6c11ca51d5fd14d159 /ui/curses.c | |
parent | 633aa0acfe2c4d3e56acfe28c912796bf54de6d3 (diff) | |
download | qemu-d03703c81a202cea156811e5dbc8e88627c19986.zip qemu-d03703c81a202cea156811e5dbc8e88627c19986.tar.gz qemu-d03703c81a202cea156811e5dbc8e88627c19986.tar.bz2 |
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>
Diffstat (limited to 'ui/curses.c')
-rw-r--r-- | ui/curses.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/ui/curses.c b/ui/curses.c index ed3165e..82bc614 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -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; } |