mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-28 05:35:52 +03:00
KeyboardDevice: Rename 0xe0 flag for clarity.
This commit is contained in:
parent
0979f372a6
commit
7b6aba4284
Notes:
sideshowbarker
2024-07-19 11:39:51 +09:00
Author: https://github.com/Nufflee Commit: https://github.com/SerenityOS/serenity/commit/7b6aba42843 Pull-request: https://github.com/SerenityOS/serenity/pull/657 Reviewed-by: https://github.com/awesomekling
@ -247,7 +247,7 @@ void KeyboardDevice::key_state_changed(u8 raw, bool pressed)
|
||||
if (key == Key_NumLock && pressed)
|
||||
m_num_lock_on = !m_num_lock_on;
|
||||
|
||||
if (m_num_lock_on && m_is_numpad_key)
|
||||
if (m_num_lock_on && !m_has_e0_prefix)
|
||||
{
|
||||
if (raw >= 0x47 && raw <= 0x53)
|
||||
{
|
||||
@ -283,7 +283,7 @@ void KeyboardDevice::key_state_changed(u8 raw, bool pressed)
|
||||
m_client->on_key_pressed(event);
|
||||
m_queue.enqueue(event);
|
||||
|
||||
m_is_numpad_key = true;
|
||||
m_has_e0_prefix = false;
|
||||
}
|
||||
|
||||
void KeyboardDevice::handle_irq()
|
||||
@ -296,6 +296,11 @@ void KeyboardDevice::handle_irq()
|
||||
u8 ch = raw & 0x7f;
|
||||
bool pressed = !(raw & 0x80);
|
||||
|
||||
if (raw == 0xe0) {
|
||||
m_has_e0_prefix = true;
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef KEYBOARD_DEBUG
|
||||
dbgprintf("Keyboard::handle_irq: %b %s\n", ch, pressed ? "down" : "up");
|
||||
#endif
|
||||
@ -313,10 +318,6 @@ void KeyboardDevice::handle_irq()
|
||||
case 0x36:
|
||||
update_modifier(Mod_Shift, pressed);
|
||||
break;
|
||||
case 0x60:
|
||||
// This flag means next key pressed could be but is not a numpad key.
|
||||
m_is_numpad_key = false;
|
||||
return;
|
||||
}
|
||||
switch (ch) {
|
||||
case I8042_ACK:
|
||||
|
@ -49,7 +49,7 @@ private:
|
||||
u8 m_modifiers { 0 };
|
||||
bool m_caps_lock_on { false };
|
||||
bool m_num_lock_on { false };
|
||||
bool m_is_numpad_key { false };
|
||||
bool m_has_e0_prefix { false };
|
||||
};
|
||||
|
||||
class KeyboardClient {
|
||||
|
Loading…
Reference in New Issue
Block a user