Skip to content

Commit

Permalink
keyboard: fix broken A/S to CAPS/CTRL mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Fosdick committed Feb 5, 2023
1 parent a790022 commit 22aefcd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 22aefcd

Please sign in to comment.