From 22aefcd2428a5b4bf003c3ffeaf3834397a1a155 Mon Sep 17 00:00:00 2001 From: Steve Fosdick Date: Sun, 5 Feb 2023 21:36:33 +0000 Subject: [PATCH] keyboard: fix broken A/S to CAPS/CTRL mode. --- src/keyboard.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index f82c2cf0..77ee4b83 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1045,6 +1045,8 @@ void key_char_event(const ALLEGRO_EVENT *event) keycode = map_keypad_intern(keycode, unichar); if (keycode == ALLEGRO_KEY_A && keyas && !keylogical) keycode = ALLEGRO_KEY_CAPSLOCK; + else if (keycode == ALLEGRO_KEY_S && keyas && !keylogical) + keycode = ALLEGRO_KEY_LCTRL; for (int act = 0; act < KEY_ACTION_MAX; act++) { log_debug("keyboard: checking key action %d:%s codes %d<>%d, alt %d<>%d", act, keyact_const[act].name, keycode, keyactions[act].keycode, hostalt, keyactions[act].altstate); if (keycode == keyactions[act].keycode && keyactions[act].altstate == hostalt) { @@ -1088,6 +1090,10 @@ void key_up_event(const ALLEGRO_EVENT *event) hostctrl = false; shiftctrl = true; } + else if (keycode == ALLEGRO_KEY_A && keyas && !keylogical) + keycode = ALLEGRO_KEY_CAPSLOCK; + else if (keycode == ALLEGRO_KEY_S && keyas && !keylogical) + keycode = ALLEGRO_KEY_LCTRL; if (shiftctrl && keylogical) set_logical_shift_ctrl_if_idle(); keycode = map_keypad_intern(keycode, unichar);