summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-23 20:47:45 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-23 20:47:45 +0200
commitf042b3adeb03234b7333eece8fccc6261fe548a6 (patch)
tree35a3bdfdae631b111369ab96731c44a2ae2d9f5b
parentf520d8709729da389c303920b77b6da296ce2d6a (diff)
downloadserenity-f042b3adeb03234b7333eece8fccc6261fe548a6.zip
Kernel: Make the right shift key work.
I never realized the right shift key wasn't hooked up since my left pinky always hovers over the left shift key, ready to rock.
-rw-r--r--Kernel/Devices/KeyboardDevice.cpp29
-rw-r--r--Kernel/KeyCode.h5
2 files changed, 24 insertions, 10 deletions
diff --git a/Kernel/Devices/KeyboardDevice.cpp b/Kernel/Devices/KeyboardDevice.cpp
index 1284d71b4b..9348ed7f23 100644
--- a/Kernel/Devices/KeyboardDevice.cpp
+++ b/Kernel/Devices/KeyboardDevice.cpp
@@ -44,11 +44,12 @@ 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, // 42
+ Key_LeftShift, // 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, // 54
- Key_Invalid, Key_Invalid,
+ Key_RightShift, // 54
+ Key_Invalid,
+ Key_Alt, // 56
Key_Space, // 57
Key_Invalid, // 58
Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, Key_F6, Key_F7, Key_F8, Key_F9, Key_F10,
@@ -86,11 +87,12 @@ static KeyCode shifted_key_map[0x100] =
Key_Return,
Key_Control,
Key_A, Key_S, Key_D, Key_F, Key_G, Key_H, Key_J, Key_K, Key_L, Key_Colon, Key_DoubleQuote, Key_Tilde,
- Key_Shift,
+ Key_LeftShift, // 42
Key_Pipe,
Key_Z, Key_X, Key_C, Key_V, Key_B, Key_N, Key_M, Key_LessThan, Key_GreaterThan, Key_QuestionMark,
+ Key_RightShift, // 54
+ Key_Invalid,
Key_Alt,
- Key_Invalid, Key_Invalid,
Key_Space, // 57
Key_Invalid, // 58
Key_F1, Key_F2, Key_F3, Key_F4, Key_F5, Key_F6, Key_F7, Key_F8, Key_F9, Key_F10,
@@ -146,10 +148,19 @@ void KeyboardDevice::handle_irq()
dbgprintf("Keyboard::handle_irq: %b %s\n", ch, pressed ? "down" : "up");
#endif
switch (ch) {
- case 0x38: update_modifier(Mod_Alt, pressed); break;
- case 0x1d: update_modifier(Mod_Ctrl, pressed); break;
- case 0x2a: update_modifier(Mod_Shift, pressed); break;
- case 0x5b: update_modifier(Mod_Logo, pressed); break;
+ case 0x38:
+ update_modifier(Mod_Alt, pressed);
+ break;
+ case 0x1d:
+ update_modifier(Mod_Ctrl, pressed);
+ break;
+ case 0x5b:
+ update_modifier(Mod_Logo, pressed);
+ break;
+ case 0x2a:
+ case 0x36:
+ update_modifier(Mod_Shift, pressed);
+ break;
}
switch (ch) {
case I8042_ACK: break;
diff --git a/Kernel/KeyCode.h b/Kernel/KeyCode.h
index bd62dceb31..310c950ca9 100644
--- a/Kernel/KeyCode.h
+++ b/Kernel/KeyCode.h
@@ -20,7 +20,8 @@ enum KeyCode : byte {
Key_Down,
Key_PageUp,
Key_PageDown,
- Key_Shift,
+ Key_LeftShift,
+ Key_RightShift,
Key_Control,
Key_Alt,
Key_CapsLock,
@@ -108,6 +109,8 @@ enum KeyCode : byte {
Key_Tilde,
Key_Backtick,
Key_Logo,
+
+ Key_Shift = Key_LeftShift,
};
enum KeyModifier {