From e933f61f70b8558f96718b6647f65a98c6cf5633 Mon Sep 17 00:00:00 2001 From: Kevin Lange Date: Thu, 20 Aug 2015 17:06:38 -0700 Subject: [PATCH] Fix a few control keys --- userspace/lib/kbd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/userspace/lib/kbd.c b/userspace/lib/kbd.c index 81708799..3dbfaa2a 100644 --- a/userspace/lib/kbd.c +++ b/userspace/lib/kbd.c @@ -258,7 +258,11 @@ int kbd_scancode(key_event_state_t * state, unsigned char c, key_event_t * event { event->keycode = kbd_us[c]; if (state->k_ctrl) { - int out = (int)(kbd_us_l2[c] - KEY_CTRL_MASK); + int s = kbd_us[c]; + if (s >= 'a' && s <= 'z') s -= 'a' - 'A'; + if (s == '-') s = '_'; + if (s == '`') s = '@'; + int out = (int)(s - KEY_CTRL_MASK); if (out < 0 || out > 0x1F) { event->key = kbd_us[c]; } else {