mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
Kernel/HID: Don't update the remapped Ctrl modifier unconditionally
Instead, only update it when the Caps Lock key event is generated and remapping to the Ctrl key is enabled. This fixes a bug that when enabling remapping Caps Lock key to the Ctrl key, the original Ctrl key is no longer usable.
This commit is contained in:
parent
c3b8b3124c
commit
07b83cf3fa
1 changed files with 2 additions and 3 deletions
|
@ -246,11 +246,10 @@ void KeyboardDevice::key_state_changed(u8 scan_code, bool pressed)
|
|||
if (!g_caps_lock_remapped_to_ctrl && key == Key_CapsLock && pressed)
|
||||
m_caps_lock_on = !m_caps_lock_on;
|
||||
|
||||
if (g_caps_lock_remapped_to_ctrl && key == Key_CapsLock)
|
||||
if (g_caps_lock_remapped_to_ctrl && key == Key_CapsLock) {
|
||||
m_caps_lock_to_ctrl_pressed = pressed;
|
||||
|
||||
if (g_caps_lock_remapped_to_ctrl)
|
||||
update_modifier(Mod_Ctrl, m_caps_lock_to_ctrl_pressed);
|
||||
}
|
||||
|
||||
if (pressed)
|
||||
event.flags |= Is_Press;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue