mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03: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
Notes:
sideshowbarker
2024-07-17 06:54:15 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/07b83cf3fa Pull-request: https://github.com/SerenityOS/serenity/pull/18115 Reviewed-by: https://github.com/trflynn89 ✅
@ -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…
Reference in New Issue
Block a user