From af8575b47b4413f2bc39fa782a616e65ede6f1dc Mon Sep 17 00:00:00 2001 From: OBattler Date: Sun, 9 Apr 2023 04:57:48 +0200 Subject: [PATCH] Made keyboard_input() correctly translate 0xe11d into the 0x0100 special case. --- src/device/keyboard.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/device/keyboard.c b/src/device/keyboard.c index 74bf3f67e..38d65b408 100644 --- a/src/device/keyboard.c +++ b/src/device/keyboard.c @@ -125,9 +125,13 @@ key_process(uint16_t scan, int down) void keyboard_input(int down, uint16_t scan) { + /* Special case for E1 1D, translate it to 0100 - special case. */ + if ((scan >> 8) == 0xe1) { + if ((scan & 0xff) == 0x1d) + scan = 0x0100; /* Translate E0 xx scan codes to 01xx because we use 512-byte arrays for states and scan code sets. */ - if ((scan >> 8) == 0xe0) { + } else if ((scan >> 8) == 0xe0) { scan &= 0x00ff; scan |= 0x0100; /* extended key code */ } else if ((scan >> 8) != 0x01)