Kernel: Fix PS/2 scancode set detection logic

If we cannot determine current scancode set because either the keyboard
does not respond or responds with bogus value, assume scancode set 1 and
mark the scancode set as uncertain. If we receive the byte 0xF0 while
having the uncertain flag set, swap to scancode set 2. 0xF0 is unused in
scancode set 1 but indicates key release in scancode set 2, so it will
be sent after every key press.
This commit is contained in:
2026-08-22 11:57:19 +03:00
parent 892829adeb
commit 28bd9cf353
2 changed files with 16 additions and 2 deletions
@@ -36,6 +36,7 @@ namespace Kernel::Input
uint8_t m_byte_index { 0 };
bool m_basic { false };
bool m_scancode_set_uncertain { false };
uint8_t m_scancode_set { 0xFF };
uint16_t m_modifiers { 0 };