mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 11:48:32 +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:
committed by
Andreas Kling
parent
452150c632
commit
f51834d610
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user