From 860837d894cec1489157fd25c6b81d5c5b7f524a Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 9 Nov 2019 18:02:14 -0500 Subject: [PATCH] Corrects: KeyPad -> Keypad. Also fleshes out Atari ST keyboard mapping. --- Inputs/Keyboard.hpp | 10 ++--- Machines/AmstradCPC/Keyboard.cpp | 24 ++++++------ Machines/Apple/Macintosh/Keyboard.cpp | 36 +++++++++--------- Machines/Apple/Macintosh/Keyboard.hpp | 36 +++++++++--------- Machines/Atari/ST/IntelligentKeyboard.cpp | 38 +++++++++---------- Machines/Atari/ST/IntelligentKeyboard.hpp | 2 +- Machines/Electron/Keyboard.cpp | 8 ++-- .../Mac/Clock Signal/Machine/CSMachine.mm | 16 ++++---- OSBindings/SDL/main.cpp | 16 ++++---- 9 files changed, 93 insertions(+), 93 deletions(-) diff --git a/Inputs/Keyboard.hpp b/Inputs/Keyboard.hpp index f93d96179..28e5054f1 100644 --- a/Inputs/Keyboard.hpp +++ b/Inputs/Keyboard.hpp @@ -30,11 +30,11 @@ class Keyboard { LeftControl, LeftOption, LeftMeta, Space, RightMeta, RightOption, RightControl, Left, Right, Up, Down, Insert, Home, PageUp, Delete, End, PageDown, - NumLock, KeyPadSlash, KeyPadAsterisk, KeyPadDelete, - KeyPad7, KeyPad8, KeyPad9, KeyPadPlus, - KeyPad4, KeyPad5, KeyPad6, KeyPadMinus, - KeyPad1, KeyPad2, KeyPad3, KeyPadEnter, - KeyPad0, KeyPadDecimalPoint, KeyPadEquals, + NumLock, KeypadSlash, KeypadAsterisk, KeypadDelete, + Keypad7, Keypad8, Keypad9, KeypadPlus, + Keypad4, Keypad5, Keypad6, KeypadMinus, + Keypad1, Keypad2, Keypad3, KeypadEnter, + Keypad0, KeypadDecimalPoint, KeypadEquals, Help }; diff --git a/Machines/AmstradCPC/Keyboard.cpp b/Machines/AmstradCPC/Keyboard.cpp index c21f624b3..f3476505f 100644 --- a/Machines/AmstradCPC/Keyboard.cpp +++ b/Machines/AmstradCPC/Keyboard.cpp @@ -57,19 +57,19 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { BIND(Left, KeyLeft); BIND(Right, KeyRight); BIND(Up, KeyUp); BIND(Down, KeyDown); - BIND(KeyPad0, KeyF0); - BIND(KeyPad1, KeyF1); BIND(KeyPad2, KeyF2); BIND(KeyPad3, KeyF3); - BIND(KeyPad4, KeyF4); BIND(KeyPad5, KeyF5); BIND(KeyPad6, KeyF6); - BIND(KeyPad7, KeyF7); BIND(KeyPad8, KeyF8); BIND(KeyPad9, KeyF9); - BIND(KeyPadPlus, KeySemicolon); - BIND(KeyPadMinus, KeyMinus); + BIND(Keypad0, KeyF0); + BIND(Keypad1, KeyF1); BIND(Keypad2, KeyF2); BIND(Keypad3, KeyF3); + BIND(Keypad4, KeyF4); BIND(Keypad5, KeyF5); BIND(Keypad6, KeyF6); + BIND(Keypad7, KeyF7); BIND(Keypad8, KeyF8); BIND(Keypad9, KeyF9); + BIND(KeypadPlus, KeySemicolon); + BIND(KeypadMinus, KeyMinus); - BIND(KeyPadEnter, KeyEnter); - BIND(KeyPadDecimalPoint, KeyFullStop); - BIND(KeyPadEquals, KeyMinus); - BIND(KeyPadSlash, KeyForwardSlash); - BIND(KeyPadAsterisk, KeyColon); - BIND(KeyPadDelete, KeyDelete); + BIND(KeypadEnter, KeyEnter); + BIND(KeypadDecimalPoint, KeyFullStop); + BIND(KeypadEquals, KeyMinus); + BIND(KeypadSlash, KeyForwardSlash); + BIND(KeypadAsterisk, KeyColon); + BIND(KeypadDelete, KeyDelete); } #undef BIND } diff --git a/Machines/Apple/Macintosh/Keyboard.cpp b/Machines/Apple/Macintosh/Keyboard.cpp index 4be2dcffe..af3f3f894 100644 --- a/Machines/Apple/Macintosh/Keyboard.cpp +++ b/Machines/Apple/Macintosh/Keyboard.cpp @@ -63,25 +63,25 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { Bind(Space, MacKey::Space); Bind(Backslash, MacKey::Backslash); - Bind(KeyPadDelete, MacKey::KeyPadDelete); - Bind(KeyPadEquals, MacKey::KeyPadEquals); - Bind(KeyPadSlash, MacKey::KeyPadSlash); - Bind(KeyPadAsterisk, MacKey::KeyPadAsterisk); - Bind(KeyPadMinus, MacKey::KeyPadMinus); - Bind(KeyPadPlus, MacKey::KeyPadPlus); - Bind(KeyPadEnter, MacKey::KeyPadEnter); - Bind(KeyPadDecimalPoint, MacKey::KeyPadDecimalPoint); + Bind(KeypadDelete, MacKey::KeypadDelete); + Bind(KeypadEquals, MacKey::KeypadEquals); + Bind(KeypadSlash, MacKey::KeypadSlash); + Bind(KeypadAsterisk, MacKey::KeypadAsterisk); + Bind(KeypadMinus, MacKey::KeypadMinus); + Bind(KeypadPlus, MacKey::KeypadPlus); + Bind(KeypadEnter, MacKey::KeypadEnter); + Bind(KeypadDecimalPoint, MacKey::KeypadDecimalPoint); - Bind(KeyPad9, MacKey::KeyPad9); - Bind(KeyPad8, MacKey::KeyPad8); - Bind(KeyPad7, MacKey::KeyPad7); - Bind(KeyPad6, MacKey::KeyPad6); - Bind(KeyPad5, MacKey::KeyPad5); - Bind(KeyPad4, MacKey::KeyPad4); - Bind(KeyPad3, MacKey::KeyPad3); - Bind(KeyPad2, MacKey::KeyPad2); - Bind(KeyPad1, MacKey::KeyPad1); - Bind(KeyPad0, MacKey::KeyPad0); + Bind(Keypad9, MacKey::Keypad9); + Bind(Keypad8, MacKey::Keypad8); + Bind(Keypad7, MacKey::Keypad7); + Bind(Keypad6, MacKey::Keypad6); + Bind(Keypad5, MacKey::Keypad5); + Bind(Keypad4, MacKey::Keypad4); + Bind(Keypad3, MacKey::Keypad3); + Bind(Keypad2, MacKey::Keypad2); + Bind(Keypad1, MacKey::Keypad1); + Bind(Keypad0, MacKey::Keypad0); #undef Bind } diff --git a/Machines/Apple/Macintosh/Keyboard.hpp b/Machines/Apple/Macintosh/Keyboard.hpp index b654ef107..65c043268 100644 --- a/Machines/Apple/Macintosh/Keyboard.hpp +++ b/Machines/Apple/Macintosh/Keyboard.hpp @@ -63,25 +63,25 @@ enum class Key: uint16_t { Up = KeypadMask | 0x1b, Down = KeypadMask | 0x11, - KeyPadDelete = KeypadMask | 0x0f, - KeyPadEquals = KeypadMask | 0x11, - KeyPadSlash = KeypadMask | 0x1b, - KeyPadAsterisk = KeypadMask | 0x05, - KeyPadMinus = KeypadMask | 0x1d, - KeyPadPlus = KeypadMask | 0x0d, - KeyPadEnter = KeypadMask | 0x19, - KeyPadDecimalPoint = KeypadMask | 0x03, + KeypadDelete = KeypadMask | 0x0f, + KeypadEquals = KeypadMask | 0x11, + KeypadSlash = KeypadMask | 0x1b, + KeypadAsterisk = KeypadMask | 0x05, + KeypadMinus = KeypadMask | 0x1d, + KeypadPlus = KeypadMask | 0x0d, + KeypadEnter = KeypadMask | 0x19, + KeypadDecimalPoint = KeypadMask | 0x03, - KeyPad9 = KeypadMask | 0x39, - KeyPad8 = KeypadMask | 0x37, - KeyPad7 = KeypadMask | 0x33, - KeyPad6 = KeypadMask | 0x31, - KeyPad5 = KeypadMask | 0x2f, - KeyPad4 = KeypadMask | 0x2d, - KeyPad3 = KeypadMask | 0x2b, - KeyPad2 = KeypadMask | 0x29, - KeyPad1 = KeypadMask | 0x27, - KeyPad0 = KeypadMask | 0x25 + Keypad9 = KeypadMask | 0x39, + Keypad8 = KeypadMask | 0x37, + Keypad7 = KeypadMask | 0x33, + Keypad6 = KeypadMask | 0x31, + Keypad5 = KeypadMask | 0x2f, + Keypad4 = KeypadMask | 0x2d, + Keypad3 = KeypadMask | 0x2b, + Keypad2 = KeypadMask | 0x29, + Keypad1 = KeypadMask | 0x27, + Keypad0 = KeypadMask | 0x25 }; class Keyboard { diff --git a/Machines/Atari/ST/IntelligentKeyboard.cpp b/Machines/Atari/ST/IntelligentKeyboard.cpp index b4cb0d621..c644508b5 100644 --- a/Machines/Atari/ST/IntelligentKeyboard.cpp +++ b/Machines/Atari/ST/IntelligentKeyboard.cpp @@ -264,7 +264,8 @@ uint16_t IntelligentKeyboard::KeyboardMapper::mapped_key_for_key(Inputs::Keyboar QBind(Left); QBind(Right); QBind(Up); QBind(Down); QBind(BackTick); QBind(Tab); - QBind(Hyphen); QBind(Equals); QBind(Backspace); + QBind(Hyphen); QBind(Equals); + QBind(Backspace); QBind(Delete); QBind(OpenSquareBracket); QBind(CloseSquareBracket); QBind(CapsLock); @@ -273,6 +274,13 @@ uint16_t IntelligentKeyboard::KeyboardMapper::mapped_key_for_key(Inputs::Keyboar Bind(Enter, Return); QBind(LeftShift); QBind(RightShift); + QBind(Escape); + QBind(Home); + QBind(Insert); + + Bind(F12, Help); Bind(F11, Help); + Bind(PageUp, Undo); + Bind(PageDown, ISO); Bind(Comma, Comma); Bind(FullStop, FullStop); @@ -280,28 +288,20 @@ uint16_t IntelligentKeyboard::KeyboardMapper::mapped_key_for_key(Inputs::Keyboar Bind(LeftOption, Alt); Bind(RightOption, Alt); + Bind(LeftControl, Control); + Bind(RightControl, Control); QBind(Space); QBind(Backslash); -/* Bind(KeyPadDelete, KeyPadDelete); - Bind(KeyPadEquals, KeyPadEquals); - Bind(KeyPadSlash, KeyPadSlash); - Bind(KeyPadAsterisk, KeyPadAsterisk); - Bind(KeyPadMinus, KeyPadMinus); - Bind(KeyPadPlus, KeyPadPlus); - Bind(KeyPadEnter, KeyPadEnter); - Bind(KeyPadDecimalPoint, KeyPadDecimalPoint); + QBind(Keypad0); QBind(Keypad1); QBind(Keypad2); QBind(Keypad3); QBind(Keypad4); + QBind(Keypad5); QBind(Keypad6); QBind(Keypad7); QBind(Keypad8); QBind(Keypad9); + QBind(KeypadMinus); + QBind(KeypadPlus); + QBind(KeypadDecimalPoint); + QBind(KeypadEnter); - Bind(KeyPad9, KeyPad9); - Bind(KeyPad8, KeyPad8); - Bind(KeyPad7, KeyPad7); - Bind(KeyPad6, KeyPad6); - Bind(KeyPad5, KeyPad5); - Bind(KeyPad4, KeyPad4); - Bind(KeyPad3, KeyPad3); - Bind(KeyPad2, KeyPad2); - Bind(KeyPad1, KeyPad1); - Bind(KeyPad0, KeyPad0);*/ + QBind(F1); QBind(F2); QBind(F3); QBind(F4); QBind(F5); + QBind(F6); QBind(F7); QBind(F8); QBind(F9); QBind(F10); #undef QBind #undef Bind diff --git a/Machines/Atari/ST/IntelligentKeyboard.hpp b/Machines/Atari/ST/IntelligentKeyboard.hpp index 0876624c2..f81cfcc08 100644 --- a/Machines/Atari/ST/IntelligentKeyboard.hpp +++ b/Machines/Atari/ST/IntelligentKeyboard.hpp @@ -36,7 +36,7 @@ enum class Key: uint16_t { Down = 0x50, Insert = 0x52, Delete, ISO = 0x60, Undo, Help, KeypadOpenBracket, KeypadCloseBracket, KeypadDivide, KeypadMultiply, - Keypad7, Keypad8, Keypad9, Keypad4, KeyPad5, Keypad6, Keypad1, Keypad2, Keypad3, Keypad0, KeypadDecimalPoint, + Keypad7, Keypad8, Keypad9, Keypad4, Keypad5, Keypad6, Keypad1, Keypad2, Keypad3, Keypad0, KeypadDecimalPoint, KeypadEnter }; static_assert(uint16_t(Key::RightShift) == 0x36, "RightShift should have key code 0x36; check intermediate entries"); diff --git a/Machines/Electron/Keyboard.cpp b/Machines/Electron/Keyboard.cpp index e7dd11f60..e54454171 100644 --- a/Machines/Electron/Keyboard.cpp +++ b/Machines/Electron/Keyboard.cpp @@ -42,12 +42,12 @@ uint16_t KeyboardMapper::mapped_key_for_key(Inputs::Keyboard::Key key) { BIND(Hyphen, KeyMinus); BIND(Delete, KeyDelete); BIND(Backspace, KeyDelete); - BIND(Enter, KeyReturn); BIND(KeyPadEnter, KeyReturn); + BIND(Enter, KeyReturn); BIND(KeypadEnter, KeyReturn); - BIND(KeyPad0, Key0); BIND(KeyPad1, Key1); BIND(KeyPad2, Key2); BIND(KeyPad3, Key3); BIND(KeyPad4, Key4); - BIND(KeyPad5, Key5); BIND(KeyPad6, Key6); BIND(KeyPad7, Key7); BIND(KeyPad8, Key8); BIND(KeyPad9, Key9); + BIND(Keypad0, Key0); BIND(Keypad1, Key1); BIND(Keypad2, Key2); BIND(Keypad3, Key3); BIND(Keypad4, Key4); + BIND(Keypad5, Key5); BIND(Keypad6, Key6); BIND(Keypad7, Key7); BIND(Keypad8, Key8); BIND(Keypad9, Key9); - BIND(KeyPadMinus, KeyMinus); BIND(KeyPadPlus, KeyColon); + BIND(KeypadMinus, KeyMinus); BIND(KeypadPlus, KeyColon); BIND(Space, KeySpace); } diff --git a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm index af942fb81..a8160f139 100644 --- a/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm +++ b/OSBindings/Mac/Clock Signal/Machine/CSMachine.mm @@ -405,10 +405,10 @@ struct ActivityObserver: public Activity::Observer { BIND(VK_F5, F5); BIND(VK_F6, F6); BIND(VK_F7, F7); BIND(VK_F8, F8); BIND(VK_F9, F9); BIND(VK_F10, F10); BIND(VK_F11, F11); BIND(VK_F12, F12); - BIND(VK_ANSI_Keypad0, KeyPad0); BIND(VK_ANSI_Keypad1, KeyPad1); BIND(VK_ANSI_Keypad2, KeyPad2); - BIND(VK_ANSI_Keypad3, KeyPad3); BIND(VK_ANSI_Keypad4, KeyPad4); BIND(VK_ANSI_Keypad5, KeyPad5); - BIND(VK_ANSI_Keypad6, KeyPad6); BIND(VK_ANSI_Keypad7, KeyPad7); BIND(VK_ANSI_Keypad8, KeyPad8); - BIND(VK_ANSI_Keypad9, KeyPad9); + BIND(VK_ANSI_Keypad0, Keypad0); BIND(VK_ANSI_Keypad1, Keypad1); BIND(VK_ANSI_Keypad2, Keypad2); + BIND(VK_ANSI_Keypad3, Keypad3); BIND(VK_ANSI_Keypad4, Keypad4); BIND(VK_ANSI_Keypad5, Keypad5); + BIND(VK_ANSI_Keypad6, Keypad6); BIND(VK_ANSI_Keypad7, Keypad7); BIND(VK_ANSI_Keypad8, Keypad8); + BIND(VK_ANSI_Keypad9, Keypad9); BIND(VK_ANSI_Equal, Equals); BIND(VK_ANSI_Minus, Hyphen); BIND(VK_ANSI_RightBracket, CloseSquareBracket); BIND(VK_ANSI_LeftBracket, OpenSquareBracket); @@ -418,10 +418,10 @@ struct ActivityObserver: public Activity::Observer { BIND(VK_ANSI_Backslash, Backslash); BIND(VK_ANSI_Slash, ForwardSlash); BIND(VK_ANSI_Comma, Comma); BIND(VK_ANSI_Period, FullStop); - BIND(VK_ANSI_KeypadDecimal, KeyPadDecimalPoint); BIND(VK_ANSI_KeypadEquals, KeyPadEquals); - BIND(VK_ANSI_KeypadMultiply, KeyPadAsterisk); BIND(VK_ANSI_KeypadDivide, KeyPadSlash); - BIND(VK_ANSI_KeypadPlus, KeyPadPlus); BIND(VK_ANSI_KeypadMinus, KeyPadMinus); - BIND(VK_ANSI_KeypadClear, KeyPadDelete); BIND(VK_ANSI_KeypadEnter, KeyPadEnter); + BIND(VK_ANSI_KeypadDecimal, KeypadDecimalPoint); BIND(VK_ANSI_KeypadEquals, KeypadEquals); + BIND(VK_ANSI_KeypadMultiply, KeypadAsterisk); BIND(VK_ANSI_KeypadDivide, KeypadSlash); + BIND(VK_ANSI_KeypadPlus, KeypadPlus); BIND(VK_ANSI_KeypadMinus, KeypadMinus); + BIND(VK_ANSI_KeypadClear, KeypadDelete); BIND(VK_ANSI_KeypadEnter, KeypadEnter); BIND(VK_Return, Enter); BIND(VK_Tab, Tab); BIND(VK_Space, Space); BIND(VK_Delete, Backspace); diff --git a/OSBindings/SDL/main.cpp b/OSBindings/SDL/main.cpp index 02405664c..cde2106fa 100644 --- a/OSBindings/SDL/main.cpp +++ b/OSBindings/SDL/main.cpp @@ -180,10 +180,10 @@ bool KeyboardKeyForSDLScancode(SDL_Keycode scancode, Inputs::Keyboard::Key &key) BIND(Z, Z) BIND(X, X) BIND(C, C) BIND(V, V) BIND(B, B) BIND(N, N) BIND(M, M) - BIND(KP_7, KeyPad7) BIND(KP_8, KeyPad8) BIND(KP_9, KeyPad9) - BIND(KP_4, KeyPad4) BIND(KP_5, KeyPad5) BIND(KP_6, KeyPad6) - BIND(KP_1, KeyPad1) BIND(KP_2, KeyPad2) BIND(KP_3, KeyPad3) - BIND(KP_0, KeyPad0) + BIND(KP_7, Keypad7) BIND(KP_8, Keypad8) BIND(KP_9, Keypad9) + BIND(KP_4, Keypad4) BIND(KP_5, Keypad5) BIND(KP_6, Keypad6) + BIND(KP_1, Keypad1) BIND(KP_2, Keypad2) BIND(KP_3, Keypad3) + BIND(KP_0, Keypad0) BIND(ESCAPE, Escape) @@ -210,10 +210,10 @@ bool KeyboardKeyForSDLScancode(SDL_Keycode scancode, Inputs::Keyboard::Key &key) BIND(INSERT, Insert) BIND(HOME, Home) BIND(PAGEUP, PageUp) BIND(DELETE, Delete) BIND(END, End) BIND(PAGEDOWN, PageDown) - BIND(NUMLOCKCLEAR, NumLock) BIND(KP_DIVIDE, KeyPadSlash) BIND(KP_MULTIPLY, KeyPadAsterisk) - BIND(KP_PLUS, KeyPadPlus) BIND(KP_MINUS, KeyPadMinus) BIND(KP_ENTER, KeyPadEnter) - BIND(KP_DECIMAL, KeyPadDecimalPoint) - BIND(KP_EQUALS, KeyPadEquals) + BIND(NUMLOCKCLEAR, NumLock) BIND(KP_DIVIDE, KeypadSlash) BIND(KP_MULTIPLY, KeypadAsterisk) + BIND(KP_PLUS, KeypadPlus) BIND(KP_MINUS, KeypadMinus) BIND(KP_ENTER, KeypadEnter) + BIND(KP_DECIMAL, KeypadDecimalPoint) + BIND(KP_EQUALS, KeypadEquals) BIND(HELP, Help) // SDL doesn't seem to have scancodes for hash or keypad delete?