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:
@@ -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 };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user