aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/curses.c9
-rw-r--r--ui/curses_keys.h1
2 files changed, 7 insertions, 3 deletions
diff --git a/ui/curses.c b/ui/curses.c
index ed3165e45e..82bc614040 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;
}
diff --git a/ui/curses_keys.h b/ui/curses_keys.h
index 1decd1119d..c0d5eb452f 100644
--- a/ui/curses_keys.h
+++ b/ui/curses_keys.h
@@ -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,
};