summaryrefslogtreecommitdiff
path: root/Kernel/Keyboard.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-01-30 21:18:13 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-01-30 21:18:13 +0100
commit56b6fb198ab7bf77664da54c2f1bcaa322037317 (patch)
tree5ec860a43ec4546b635516274b19708ada0ad8d6 /Kernel/Keyboard.cpp
parentf176af7cd1ff978e6444b273fa1a81fa9998c83f (diff)
downloadserenity-56b6fb198ab7bf77664da54c2f1bcaa322037317.zip
Add support for keyboard arrow keys.
Also have them send the appropriate escape sequences in Terminal. Basic history browsing now works in bash. How nice! :^)
Diffstat (limited to 'Kernel/Keyboard.cpp')
-rw-r--r--Kernel/Keyboard.cpp37
1 files changed, 32 insertions, 5 deletions
diff --git a/Kernel/Keyboard.cpp b/Kernel/Keyboard.cpp
index d747019e62..9da766c5dd 100644
--- a/Kernel/Keyboard.cpp
+++ b/Kernel/Keyboard.cpp
@@ -42,12 +42,26 @@ static KeyCode unshifted_key_map[0x80] =
Key_Return, // 28
Key_Control, // 29
Key_A, Key_S, Key_D, Key_F, Key_G, Key_H, Key_J, Key_K, Key_L, Key_Semicolon, Key_Apostrophe, Key_Backtick,
- Key_Shift,
+ Key_Shift, // 42
Key_Backslash,
Key_Z, Key_X, Key_C, Key_V, Key_B, Key_N, Key_M, Key_Comma, Key_Period, Key_Slash,
- Key_Alt,
+ Key_Alt, // 54
+ Key_Invalid, Key_Invalid,
+ Key_Space, // 57
Key_Invalid, Key_Invalid,
- Key_Space
+ Key_Invalid, // 60
+ Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid,
+ Key_Invalid, // 70
+ Key_Invalid,
+ Key_Up,
+ Key_Invalid,
+ Key_Invalid,
+ Key_Left,
+ Key_Invalid,
+ Key_Right, // 77
+ Key_Invalid,
+ Key_Invalid,
+ Key_Down, // 80
};
static KeyCode shifted_key_map[0x100] =
@@ -64,10 +78,23 @@ static KeyCode shifted_key_map[0x100] =
Key_Z, Key_X, Key_C, Key_V, Key_B, Key_N, Key_M, Key_LessThan, Key_GreaterThan, Key_QuestionMark,
Key_Alt,
Key_Invalid, Key_Invalid,
- Key_Space
+ Key_Space,
+ Key_Invalid, Key_Invalid,
+ Key_Invalid, // 60
+ Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid, Key_Invalid,
+ Key_Invalid, // 70
+ Key_Invalid,
+ Key_Up,
+ Key_Invalid,
+ Key_Invalid,
+ Key_Left,
+ Key_Invalid,
+ Key_Right, // 77
+ Key_Invalid,
+ Key_Invalid,
+ Key_Down, // 80
};
-
void Keyboard::key_state_changed(byte raw, bool pressed)
{
Event event;