1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:07:44 +00:00

Kernel: Change the code point of numpad keys to 0, when Num Lock is off

Previously we would set the KeyCode correctly to the appropriate
extended keys values, like Home and End, but keep the code point of the
original keys, like 1, 2, 3, etc. Because of this, the keys would just
print the original keys, instead of behaving like the extended ones.
This commit is contained in:
0GreenClover0 2023-08-19 23:49:48 +02:00 committed by Andrew Kaster
parent c261e5e39b
commit 719ab586c4
3 changed files with 7 additions and 3 deletions

View file

@ -303,7 +303,7 @@ void KeyboardDevice::handle_scan_code_input_event(ScanCodeEvent event)
queued_event.flags = m_modifiers;
queued_event.e0_prefix = event.e0_prefix;
queued_event.caps_lock_on = m_caps_lock_on;
queued_event.code_point = HIDManagement::the().get_char_from_character_map(queued_event);
queued_event.code_point = HIDManagement::the().get_char_from_character_map(queued_event, m_num_lock_on);
// If using a non-QWERTY layout, queued_event.key needs to be updated to be the same as event.code_point
KeyCode mapped_key = code_point_to_key_code(queued_event.code_point);