mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:18:12 +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)
|
||||
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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue