mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 08:34:57 +00:00

This scan code set is more advanced than the basic scan code set 1, and is required to be supported for some bare metal hardware that might not properly enable the PS2 first port translation in the i8042 controller. LibWeb can now also generate bindings for keyboard events like the Pause key, as well as other function keys (such as Right Alt, etc). The logic for handling scan code sets is implemented by the PS2 keyboard driver and is abstracted from the main HID KeyboardDevice code which only handles "standard" KeyEvent(s).
32 lines
505 B
C++
32 lines
505 B
C++
/*
|
|
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Types.h>
|
|
#include <Kernel/API/KeyCode.h>
|
|
|
|
namespace Kernel {
|
|
|
|
enum class ScanCodeSet {
|
|
Set1 = 1,
|
|
Set2 = 2,
|
|
Set3 = 3,
|
|
};
|
|
|
|
struct KeyCodeEntry {
|
|
KeyCode key_code;
|
|
u8 map_entry_index;
|
|
};
|
|
|
|
struct RawKeyEvent {
|
|
KeyCodeEntry code_entry;
|
|
u64 scancode { 0 };
|
|
bool is_press_down { false };
|
|
bool is_press() const { return is_press_down; }
|
|
};
|
|
|
|
}
|