mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 23:27:43 +00:00
Kernel+Userland: Implement support for PS2 scan code set 2
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).
This commit is contained in:
parent
60a96b3786
commit
61a385fc01
12 changed files with 982 additions and 440 deletions
|
@ -34,8 +34,6 @@ public:
|
|||
virtual ErrorOr<size_t> write(OpenFileDescription&, u64, UserOrKernelBuffer const&, size_t) override { return EINVAL; }
|
||||
virtual bool can_write(OpenFileDescription const&, u64) const override { return true; }
|
||||
|
||||
void handle_scan_code_input_event(ScanCodeEvent);
|
||||
|
||||
// ^File
|
||||
virtual ErrorOr<void> ioctl(OpenFileDescription&, unsigned request, Userspace<void*> arg) override;
|
||||
|
||||
|
@ -47,6 +45,11 @@ public:
|
|||
m_modifiers &= ~modifier;
|
||||
}
|
||||
|
||||
u8 modifiers() const { return m_modifiers; }
|
||||
|
||||
void handle_input_event(KeyEvent);
|
||||
bool num_lock_on() const { return m_num_lock_on; }
|
||||
|
||||
protected:
|
||||
KeyboardDevice();
|
||||
mutable Spinlock<LockRank::None> m_queue_lock {};
|
||||
|
@ -58,10 +61,6 @@ protected:
|
|||
bool m_caps_lock_to_ctrl_pressed { false };
|
||||
bool m_caps_lock_on { false };
|
||||
bool m_num_lock_on { 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);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue