1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 19:05:08 +00:00

Kernel: Allow backspace '\b' to be remapped

Previously, one could put '\b' in a keymap, but in non-Terminal
applications, it would just insert a literal '\b' character instead of
behaving like backspace. This patch modifes
`visible_code_point_to_key_code` to include backspace, as well as
renaming it to `code_point_to_key_code` since '\b' is not a visible
character. Additionally, `KeyboardDevice::key_state_changed` has been
rearranged to apply the user's keymap before checking for things like
caps lock.
This commit is contained in:
Corey Williamson 2021-12-21 00:46:46 -06:00 committed by Andreas Kling
parent 452150c632
commit f51834d610
2 changed files with 15 additions and 12 deletions

View file

@ -168,7 +168,7 @@ inline const char* key_code_to_string(KeyCode key)
}
}
inline KeyCode visible_code_point_to_key_code(u32 code_point)
inline KeyCode code_point_to_key_code(u32 code_point)
{
switch (code_point) {
#define MATCH_ALPHA(letter) \
@ -250,6 +250,7 @@ inline KeyCode visible_code_point_to_key_code(u32 code_point)
MATCH_KEY(Backtick, '`')
MATCH_KEY(Space, ' ')
MATCH_KEY(Tab, '\t')
MATCH_KEY(Backspace, '\b')
#undef MATCH_KEY
default: