mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-23 13:05:12 +00:00
Kernel: Add scancode value to KeyEvent
This commit is contained in:
parent
ed20800320
commit
46b92fa173
Notes:
sideshowbarker
2024-07-19 05:52:08 +09:00
Author: https://github.com/asliturk Commit: https://github.com/SerenityOS/serenity/commit/46b92fa173f Pull-request: https://github.com/SerenityOS/serenity/pull/2455 Reviewed-by: https://github.com/JonArcherII Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/bugaevc
2 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
|
@ -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; }
|
||||
|
|
Loading…
Add table
Reference in a new issue