mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
KeyboardDevice: Rename 0xe0 flag for clarity.
This commit is contained in:
parent
0979f372a6
commit
7b6aba4284
2 changed files with 8 additions and 7 deletions
|
@ -247,7 +247,7 @@ void KeyboardDevice::key_state_changed(u8 raw, bool pressed)
|
||||||
if (key == Key_NumLock && pressed)
|
if (key == Key_NumLock && pressed)
|
||||||
m_num_lock_on = !m_num_lock_on;
|
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)
|
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_client->on_key_pressed(event);
|
||||||
m_queue.enqueue(event);
|
m_queue.enqueue(event);
|
||||||
|
|
||||||
m_is_numpad_key = true;
|
m_has_e0_prefix = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyboardDevice::handle_irq()
|
void KeyboardDevice::handle_irq()
|
||||||
|
@ -296,6 +296,11 @@ void KeyboardDevice::handle_irq()
|
||||||
u8 ch = raw & 0x7f;
|
u8 ch = raw & 0x7f;
|
||||||
bool pressed = !(raw & 0x80);
|
bool pressed = !(raw & 0x80);
|
||||||
|
|
||||||
|
if (raw == 0xe0) {
|
||||||
|
m_has_e0_prefix = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef KEYBOARD_DEBUG
|
#ifdef KEYBOARD_DEBUG
|
||||||
dbgprintf("Keyboard::handle_irq: %b %s\n", ch, pressed ? "down" : "up");
|
dbgprintf("Keyboard::handle_irq: %b %s\n", ch, pressed ? "down" : "up");
|
||||||
#endif
|
#endif
|
||||||
|
@ -313,10 +318,6 @@ void KeyboardDevice::handle_irq()
|
||||||
case 0x36:
|
case 0x36:
|
||||||
update_modifier(Mod_Shift, pressed);
|
update_modifier(Mod_Shift, pressed);
|
||||||
break;
|
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) {
|
switch (ch) {
|
||||||
case I8042_ACK:
|
case I8042_ACK:
|
||||||
|
|
|
@ -49,7 +49,7 @@ private:
|
||||||
u8 m_modifiers { 0 };
|
u8 m_modifiers { 0 };
|
||||||
bool m_caps_lock_on { false };
|
bool m_caps_lock_on { false };
|
||||||
bool m_num_lock_on { false };
|
bool m_num_lock_on { false };
|
||||||
bool m_is_numpad_key { false };
|
bool m_has_e0_prefix { false };
|
||||||
};
|
};
|
||||||
|
|
||||||
class KeyboardClient {
|
class KeyboardClient {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue