mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
LibKeyboard: get_char now handles e0 prefix for control keys
Control keys which have numpad counter-parts have the same scancode except for an e0 prefix. We now return a 0 code_point for those keys.
This commit is contained in:
parent
c2332780ee
commit
fea498e9ac
1 changed files with 4 additions and 0 deletions
|
@ -82,6 +82,10 @@ u32 CharacterMap::get_char(KeyEvent event)
|
||||||
if (event.e0_prefix && event.key == Key_Slash) {
|
if (event.e0_prefix && event.key == Key_Slash) {
|
||||||
// If Key_Slash (scancode = 0x35) mapped to other form "/", we fix num pad key of "/" with this case.
|
// If Key_Slash (scancode = 0x35) mapped to other form "/", we fix num pad key of "/" with this case.
|
||||||
code_point = '/';
|
code_point = '/';
|
||||||
|
} else if (event.e0_prefix) {
|
||||||
|
// Except for `keypad-/`, all e0 scan codes are not actually characters. i.e., `keypad-0` and
|
||||||
|
// `Insert` have the same scancode except for the prefix, but insert should not have a code_point.
|
||||||
|
code_point = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return code_point;
|
return code_point;
|
||||||
|
|
Loading…
Add table
Reference in a new issue