summaryrefslogtreecommitdiff
path: root/Kernel/Devices
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2022-01-30 14:59:43 +0100
committerAndreas Kling <kling@serenityos.org>2022-01-30 15:08:49 +0100
commit98d666eab397df2395119909d00b816af8ded5ea (patch)
tree7836110249a327614b1624c0359c2a9406daf7d4 /Kernel/Devices
parentc20f1e06c0f338c25c5fea2544a7e86fa623cb19 (diff)
downloadserenity-98d666eab397df2395119909d00b816af8ded5ea.zip
Kernel: Support PS/2 right super key
We currently support the left super key. This poses an issue on keyboards that only have a right super key, such as my Steelseries 6G. The implementation mirrors the left/right shift key logic and effectively considers the right super key identical to the left one.
Diffstat (limited to 'Kernel/Devices')
-rw-r--r--Kernel/Devices/HID/KeyboardDevice.h2
-rw-r--r--Kernel/Devices/HID/PS2KeyboardDevice.cpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/Kernel/Devices/HID/KeyboardDevice.h b/Kernel/Devices/HID/KeyboardDevice.h
index b96343535e..238a60894b 100644
--- a/Kernel/Devices/HID/KeyboardDevice.h
+++ b/Kernel/Devices/HID/KeyboardDevice.h
@@ -58,6 +58,8 @@ protected:
bool m_has_e0_prefix { false };
bool m_left_shift_pressed { false };
bool m_right_shift_pressed { false };
+ bool m_left_super_pressed { false };
+ bool m_right_super_pressed { false };
void key_state_changed(u8 raw, bool pressed);
};
diff --git a/Kernel/Devices/HID/PS2KeyboardDevice.cpp b/Kernel/Devices/HID/PS2KeyboardDevice.cpp
index 47d907198d..30785501d7 100644
--- a/Kernel/Devices/HID/PS2KeyboardDevice.cpp
+++ b/Kernel/Devices/HID/PS2KeyboardDevice.cpp
@@ -51,7 +51,12 @@ void PS2KeyboardDevice::irq_handle_byte_read(u8 byte)
update_modifier(Mod_Ctrl, pressed);
break;
case 0x5b:
- update_modifier(Mod_Super, pressed);
+ m_left_super_pressed = pressed;
+ update_modifier(Mod_Super, m_left_super_pressed || m_right_super_pressed);
+ break;
+ case 0x5c:
+ m_right_super_pressed = pressed;
+ update_modifier(Mod_Super, m_left_super_pressed || m_right_super_pressed);
break;
case 0x2a:
m_left_shift_pressed = pressed;