diff options
author | Hüseyin ASLITÜRK <asliturk@hotmail.com> | 2020-05-30 22:16:04 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-06-03 21:52:40 +0200 |
commit | 46b92fa173f92400e5fbe51ae8b6e860807f4420 (patch) | |
tree | fb9732e1e2f07a9dd4d6dfa6cbdb4c5cfbab93a0 /Kernel | |
parent | ed208003207882a36432d9c90e223c1dadfb135e (diff) | |
download | serenity-46b92fa173f92400e5fbe51ae8b6e860807f4420.zip |
Kernel: Add scancode value to KeyEvent
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Devices/KeyboardDevice.cpp | 3 | ||||
-rw-r--r-- | Kernel/KeyCode.h | 1 |
2 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/Devices/KeyboardDevice.cpp b/Kernel/Devices/KeyboardDevice.cpp index 7c15dc6749..9ac7f7d633 100644 --- a/Kernel/Devices/KeyboardDevice.cpp +++ b/Kernel/Devices/KeyboardDevice.cpp @@ -30,8 +30,8 @@ #include <AK/Types.h> #include <Kernel/Arch/i386/CPU.h> #include <Kernel/Devices/KeyboardDevice.h> -#include <Kernel/TTY/VirtualConsole.h> #include <Kernel/IO.h> +#include <Kernel/TTY/VirtualConsole.h> //#define KEYBOARD_DEBUG @@ -475,6 +475,7 @@ void KeyboardDevice::key_state_changed(u8 raw, bool pressed) Event event; event.key = key; + event.scancode = m_has_e0_prefix ? 0xe000 + raw : raw; event.character = static_cast<u8>(character); event.flags = m_modifiers; if (pressed) diff --git a/Kernel/KeyCode.h b/Kernel/KeyCode.h index 6d56b9449f..a80a776ac2 100644 --- a/Kernel/KeyCode.h +++ b/Kernel/KeyCode.h @@ -160,6 +160,7 @@ enum KeyModifier { struct KeyEvent { KeyCode key { Key_Invalid }; + u32 scancode { 0 }; u8 character { 0 }; u8 flags { 0 }; bool alt() const { return flags & Mod_Alt; } |