From b191a0dc585d4c418f488764d62c926b77cfdb06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Sat, 9 Sep 2017 01:21:29 +0200 Subject: [PATCH] Use Scan prefix instead of 's' Also use getDescription instead of localizedRepresentation --- include/SFML/Window/Keyboard.hpp | 273 ++- src/SFML/Window/Android/InputImpl.hpp | 2 +- src/SFML/Window/Keyboard.cpp | 5 +- src/SFML/Window/OSX/HIDInputManager.hpp | 10 +- src/SFML/Window/OSX/HIDInputManager.mm | 1574 ++++++++--------- src/SFML/Window/OSX/InputImpl.hpp | 2 +- src/SFML/Window/OSX/InputImpl.mm | 2 +- .../Window/OSX/SFKeyboardModifiersHelper.mm | 8 +- src/SFML/Window/OSX/SFOpenGLView+keyboard.mm | 2 +- src/SFML/Window/Unix/InputImpl.hpp | 2 +- src/SFML/Window/Win32/InputImpl.hpp | 2 +- src/SFML/Window/iOS/InputImpl.hpp | 2 +- 12 files changed, 942 insertions(+), 942 deletions(-) diff --git a/include/SFML/Window/Keyboard.hpp b/include/SFML/Window/Keyboard.hpp index 7c057925..35e4fe2a 100644 --- a/include/SFML/Window/Keyboard.hpp +++ b/include/SFML/Window/Keyboard.hpp @@ -29,11 +29,12 @@ // Headers //////////////////////////////////////////////////////////// #include -#include namespace sf { +class String; + //////////////////////////////////////////////////////////// /// \brief Give access to the real-time state of the keyboard /// @@ -169,153 +170,151 @@ public: //////////////////////////////////////////////////////////// /// \brief Scancodes /// - /// The enumerators are bound to a physical key and do *not* depend - /// on the keyboard layout used by the operating system. Usually, the AT-101 + /// The enumerators are bound to a physical key and do not depend on + /// the keyboard layout used by the operating system. Usually, the AT-101 /// keyboard can be used as reference for the physical position of the keys. /// /// The scancodes are based on a subset of Table 12: Keyboard/Keypad Page /// of Universal Serial Bus (USB): HID Usage Tables, v1.12. /// - /// \todo When porting this for SFML 3, remove the `s` prefix and use + /// \todo When porting this for SFML 3, remove the `Scan` prefix and use /// enum class. /// //////////////////////////////////////////////////////////// enum Scancode { - sUnknown = -1, ///< Represents any scancode not present in this enum - sA = 0, ///< Keyboard a and A key - sB, ///< Keyboard b and B key - sC, ///< Keyboard c and C key - sD, ///< Keyboard d and D key - sE, ///< Keyboard e and E key - sF, ///< Keyboard f and F key - sG, ///< Keyboard g and G key - sH, ///< Keyboard h and H key - sI, ///< Keyboard i and I key - sJ, ///< Keyboard j and J key - sK, ///< Keyboard k and K key - sL, ///< Keyboard l and L key - sM, ///< Keyboard m and M key - sN, ///< Keyboard n and N key - sO, ///< Keyboard o and O key - sP, ///< Keyboard p and P key - sQ, ///< Keyboard q and Q key - sR, ///< Keyboard r and R key - sS, ///< Keyboard s and S key - sT, ///< Keyboard t and T key - sU, ///< Keyboard u and U key - sV, ///< Keyboard v and V key - sW, ///< Keyboard w and W key - sX, ///< Keyboard x and X key - sY, ///< Keyboard y and Y key - sZ, ///< Keyboard z and Z key - sNum1, ///< Keyboard 1 and ! key - sNum2, ///< Keyboard 2 and @ key - sNum3, ///< Keyboard 3 and # key - sNum4, ///< Keyboard 4 and $ key - sNum5, ///< Keyboard 5 and % key - sNum6, ///< Keyboard 6 and ^ key - sNum7, ///< Keyboard 7 and & key - sNum8, ///< Keyboard 8 and * key - sNum9, ///< Keyboard 9 and ) key - sNum0, ///< Keyboard 0 and ) key - sEnter, ///< Keyboard Return (ENTER) key - sEscape, ///< Keyboard Escape key - sBackspace, ///< Keyboard Backspace key - // TODO above it's BackSpace, but is it correct? What do we use here? - sTab, ///< Keyboard Tab key - sSpace, ///< Keyboard Space key - sHyphen, ///< Keyboard - and _ key - sEquals, ///< Keyboard = and + - sLBracket, ///< Keyboard [ and { key - sRBracket, ///< Keyboard ] and } key - sBackslash, ///< Keyboard \ and | key - // TODO capitalisation - sDash, ///< Keyboard Non-US # and ~ - sSemicolon, ///< Keyboard ; and : key - // TODO capitalisation - sQuote, ///< Keyboard ' and " key - sGraveAccent, ///< Keyboard ` and ~ key - sComma, ///< Keyboard , and < key - sPeriod, ///< Keyboard . and > key - sForwardSlash, ///< Keyboard / and ? key - sF1, ///< Keyboard F1 key - sF2, ///< Keyboard F2 key - sF3, ///< Keyboard F3 key - sF4, ///< Keyboard F4 key - sF5, ///< Keyboard F5 key - sF6, ///< Keyboard F6 key - sF7, ///< Keyboard F7 key - sF8, ///< Keyboard F8 key - sF9, ///< Keyboard F9 key - sF10, ///< Keyboard F10 key - sF11, ///< Keyboard F11 key - sF12, ///< Keyboard F12 key - sF13, ///< Keyboard F13 key - sF14, ///< Keyboard F14 key - sF15, ///< Keyboard F15 key - sCapsLock, ///< Keyboard Caps Lock key - sPrintScreen, ///< Keyboard Print Screen key - sScrollLock, ///< Keyboard Scroll Lock key - sPause, ///< Keyboard Pause key - sInsert, ///< Keyboard Insert key - sHome, ///< Keyboard Home key - sPageUp, ///< Keyboard Page Up key - sDelete, ///< Keyboard Delete Forward key - sEnd, ///< Keyboard End key - sPageDown, ///< Keyboard Page Down key - sRight, ///< Keyboard Right Arrow key - sLeft, ///< Keyboard Left Arrow key - sDown, ///< Keyboard Down Arrow key - sUp, ///< Keyboard Up Arrow key - sNumLock, ///< Keypad Num Lock and Clear key - sDivide, ///< Keypad / key - sMultiply, ///< Keypad * key - sMinus, ///< Keypad - key - sPlus, ///< Keypad + key - sPadEquals, ///< keypad = key, probably Mac only - sReturn, ///< Keypad Enter (return) key - sDecimal, ///< Keypad . and Delete key - sNumpad1, ///< Keypad 1 and End key - sNumpad2, ///< Keypad 2 and Down Arrow key - sNumpad3, ///< Keypad 3 and Page Down key - sNumpad4, ///< Keypad 4 and Left Arrow key - sNumpad5, ///< Keypad 5 key - sNumpad6, ///< Keypad 6 and Right Arrow key - sNumpad7, ///< Keypad 7 and Home key - sNumpad8, ///< Keypad 8 and Up Arrow key - sNumpad9, ///< Keypad 9 and Page Up key - sNumpad0, ///< Keypad 0 and Insert key - sReverseSolidus, ///< Keyboard Non-US \ and | key + ScanUnknown = -1, ///< Represents any scancode not present in this enum + ScanA = 0, ///< Keyboard a and A key + ScanB, ///< Keyboard b and B key + ScanC, ///< Keyboard c and C key + ScanD, ///< Keyboard d and D key + ScanE, ///< Keyboard e and E key + ScanF, ///< Keyboard f and F key + ScanG, ///< Keyboard g and G key + ScanH, ///< Keyboard h and H key + ScanI, ///< Keyboard i and I key + ScanJ, ///< Keyboard j and J key + ScanK, ///< Keyboard k and K key + ScanL, ///< Keyboard l and L key + ScanM, ///< Keyboard m and M key + ScanN, ///< Keyboard n and N key + ScanO, ///< Keyboard o and O key + ScanP, ///< Keyboard p and P key + ScanQ, ///< Keyboard q and Q key + ScanR, ///< Keyboard r and R key + ScanS, ///< Keyboard s and S key + ScanT, ///< Keyboard t and T key + ScanU, ///< Keyboard u and U key + ScanV, ///< Keyboard v and V key + ScanW, ///< Keyboard w and W key + ScanX, ///< Keyboard x and X key + ScanY, ///< Keyboard y and Y key + ScanZ, ///< Keyboard z and Z key + ScanNum1, ///< Keyboard 1 and ! key + ScanNum2, ///< Keyboard 2 and @ key + ScanNum3, ///< Keyboard 3 and # key + ScanNum4, ///< Keyboard 4 and $ key + ScanNum5, ///< Keyboard 5 and % key + ScanNum6, ///< Keyboard 6 and ^ key + ScanNum7, ///< Keyboard 7 and & key + ScanNum8, ///< Keyboard 8 and * key + ScanNum9, ///< Keyboard 9 and ) key + ScanNum0, ///< Keyboard 0 and ) key + ScanEnter, ///< Keyboard Enter/Return key + ScanEscape, ///< Keyboard Escape key + ScanBackspace, ///< Keyboard Backspace key + ScanTab, ///< Keyboard Tab key + ScanSpace, ///< Keyboard Space key + ScanHyphen, ///< Keyboard - and _ key + ScanEquals, ///< Keyboard = and + + ScanLBracket, ///< Keyboard [ and { key + ScanRBracket, ///< Keyboard ] and } key + ScanBackslash, ///< Keyboard \ and | key + ScanDash, ///< Keyboard Non-US # and ~ + // TODO hyphen vs minus vs dash + ScanSemicolon, ///< Keyboard ; and : key + ScanQuote, ///< Keyboard ' and " key + ScanGraveAccent, ///< Keyboard ` and ~ key + ScanComma, ///< Keyboard , and < key + ScanPeriod, ///< Keyboard . and > key + ScanSlash, ///< Keyboard / and ? key + ScanF1, ///< Keyboard F1 key + ScanF2, ///< Keyboard F2 key + ScanF3, ///< Keyboard F3 key + ScanF4, ///< Keyboard F4 key + ScanF5, ///< Keyboard F5 key + ScanF6, ///< Keyboard F6 key + ScanF7, ///< Keyboard F7 key + ScanF8, ///< Keyboard F8 key + ScanF9, ///< Keyboard F9 key + ScanF10, ///< Keyboard F10 key + ScanF11, ///< Keyboard F11 key + ScanF12, ///< Keyboard F12 key + ScanF13, ///< Keyboard F13 key + ScanF14, ///< Keyboard F14 key + ScanF15, ///< Keyboard F15 key + ScanCapsLock, ///< Keyboard Caps Lock key + ScanPrintScreen, ///< Keyboard Print Screen key + ScanScrollLock, ///< Keyboard Scroll Lock key + ScanPause, ///< Keyboard Pause key + ScanInsert, ///< Keyboard Insert key + ScanHome, ///< Keyboard Home key + ScanPageUp, ///< Keyboard Page Up key + ScanDelete, ///< Keyboard Delete Forward key + ScanEnd, ///< Keyboard End key + ScanPageDown, ///< Keyboard Page Down key + ScanRight, ///< Keyboard Right Arrow key + ScanLeft, ///< Keyboard Left Arrow key + ScanDown, ///< Keyboard Down Arrow key + ScanUp, ///< Keyboard Up Arrow key + ScanNumLock, ///< Keypad Num Lock and Clear key + ScanDivide, ///< Keypad / key + ScanMultiply, ///< Keypad * key + ScanMinus, ///< Keypad - key + ScanPlus, ///< Keypad + key + ScanNumpadEquals, ///< keypad = key, probably Mac only + ScanNumpadEnter, ///< Keypad Enter/Return key + ScanDecimal, ///< Keypad . and Delete key + ScanNumpad1, ///< Keypad 1 and End key + ScanNumpad2, ///< Keypad 2 and Down Arrow key + ScanNumpad3, ///< Keypad 3 and Page Down key + ScanNumpad4, ///< Keypad 4 and Left Arrow key + ScanNumpad5, ///< Keypad 5 key + ScanNumpad6, ///< Keypad 6 and Right Arrow key + ScanNumpad7, ///< Keypad 7 and Home key + ScanNumpad8, ///< Keypad 8 and Up Arrow key + ScanNumpad9, ///< Keypad 9 and Page Up key + ScanNumpad0, ///< Keypad 0 and Insert key + ScanReverseSolidus, ///< Keyboard Non-US \ and | key // FIXME what is this one? Might need better name. The doc says: // - Typically near the Left-Shift key in AT-102 implementations. // - Typical language mappings: Belg:<\> FrCa:«°» Dan:<\> Dutch:]|[ Fren:<> Ger:<|> Ital:<> LatAm:<> Nor:<> Span:<> Swed:<|> Swiss:<\> UK:\| Brazil: \|. // What is the difference with "regular" \ and | key? - sApplication, ///< Keyboard Application key - sExecute, ///< Keyboard Execute key - sHelp, ///< Keyboard Help key - sMenu, ///< Keyboard Menu key - sSelect, ///< Keyboard Select key - sStop, ///< Keyboard Stop key - sAgain, ///< Keyboard Again key - sUndo, ///< Keyboard Undo key - sCut, ///< Keyboard Cut key - sCopy, ///< Keyboard Copy key - sPaste, ///< Keyboard Paste key - sFind, ///< Keyboard Find key - sMute, ///< Keyboard Mute key - sVolumeUp, ///< Keyboard Volume Up key - sVolumeDown, ///< Keyboard Volume Down key - sLControl, ///< Keyboard Left Control key - sLShift, ///< Keyboard Left Shift key - sLAlt, ///< Keyboard Left Alt key - sLSystem, ///< Keyboard Left System key - sRControl, ///< Keyboard Right Control key - sRShift, ///< Keyboard Right Shift key - sRAlt, ///< Keyboard Right Alt key - sRSystem, ///< Keyboard Right System key + ScanApplication, ///< Keyboard Application key + ScanExecute, ///< Keyboard Execute key + ScanHelp, ///< Keyboard Help key + ScanMenu, ///< Keyboard Menu key + ScanSelect, ///< Keyboard Select key + ScanStop, ///< Keyboard Stop key + ScanAgain, ///< Keyboard Again key + ScanUndo, ///< Keyboard Undo key + ScanCut, ///< Keyboard Cut key + ScanCopy, ///< Keyboard Copy key + ScanPaste, ///< Keyboard Paste key + ScanFind, ///< Keyboard Find key + ScanMute, ///< Keyboard Mute key + ScanVolumeUp, ///< Keyboard Volume Up key + ScanVolumeDown, ///< Keyboard Volume Down key + ScanLControl, ///< Keyboard Left Control key + ScanLShift, ///< Keyboard Left Shift key + ScanLAlt, ///< Keyboard Left Alt key + ScanLSystem, ///< Keyboard Left System key + ScanRControl, ///< Keyboard Right Control key + ScanRShift, ///< Keyboard Right Shift key + ScanRAlt, ///< Keyboard Right Alt key + ScanRSystem, ///< Keyboard Right System key - sCodeCount ///< Keep last -- the total number of scancodes + ScanCodeCount ///< Keep last -- the total number of scancodes }; //////////////////////////////////////////////////////////// @@ -360,7 +359,7 @@ public: /// /// \return The scancode corresponding to the key under the current /// keyboard layout used by the operating system, or - /// sf::Keyboard::sUnknown when the key cannot be mapped + /// sf::Keyboard::ScanUnknown when the key cannot be mapped /// to a Keyboard::Scancode. /// /// \see localize @@ -376,18 +375,18 @@ public: /// when the given physical key is pressed by the user, when no /// modifiers are involved. /// - /// \warning The result is OS-dependent: for example, sf::Keyboard::sLSystem + /// \warning The result is OS-dependent: for example, sf::Keyboard::ScanLSystem /// is "Left Meta" on Linux, "Left Windows" on Windows and /// "Left Command" on macOS. /// /// The current keyboard layout set by the operating system is used to - /// interpret the scancode: for example, sf::Keyboard::SemiColon is + /// interpret the scancode: for example, sf::Keyboard::Semicolon is /// mapped to ";" for layout and to "é" for others. /// /// \return The localized description of the code /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Scancode code); + static String getDescription(Scancode code); //////////////////////////////////////////////////////////// /// \brief Show or hide the virtual keyboard diff --git a/src/SFML/Window/Android/InputImpl.hpp b/src/SFML/Window/Android/InputImpl.hpp index ffbc6312..139a5bbd 100644 --- a/src/SFML/Window/Android/InputImpl.hpp +++ b/src/SFML/Window/Android/InputImpl.hpp @@ -72,7 +72,7 @@ public: /// \copydoc sf::Keyboard::localizedRepresentation /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Keyboard::Scancode code); + static String getDescription(Keyboard::Scancode code); //////////////////////////////////////////////////////////// /// \copydoc sf::Keyboard::setVirtualKeyboardVisible diff --git a/src/SFML/Window/Keyboard.cpp b/src/SFML/Window/Keyboard.cpp index d8d25122..0f232fde 100644 --- a/src/SFML/Window/Keyboard.cpp +++ b/src/SFML/Window/Keyboard.cpp @@ -27,6 +27,7 @@ //////////////////////////////////////////////////////////// #include #include +#include namespace sf @@ -56,9 +57,9 @@ Keyboard::Scancode Keyboard::unlocalize(Key key) } //////////////////////////////////////////////////////////// -String Keyboard::localizedRepresentation(Scancode code) +String Keyboard::getDescription(Scancode code) { - return priv::InputImpl::localizedRepresentation(code); + return priv::InputImpl::getDescription(code); } //////////////////////////////////////////////////////////// diff --git a/src/SFML/Window/OSX/HIDInputManager.hpp b/src/SFML/Window/OSX/HIDInputManager.hpp index 7ead4dc2..845bad2a 100644 --- a/src/SFML/Window/OSX/HIDInputManager.hpp +++ b/src/SFML/Window/OSX/HIDInputManager.hpp @@ -115,7 +115,7 @@ public: /// Try to convert a virtual keycode (HID level) into a /// SFML scancode. /// - /// Return sf::Keyboard::sUnknown if the keycode is unknown. + /// Return sf::Keyboard::ScanUnknown if the keycode is unknown. /// //////////////////////////////////////////////////////////// static Keyboard::Scancode nonLocalizedKey(UniChar virtualKeycode); @@ -278,10 +278,10 @@ private: //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - IOHIDManagerRef m_manager; ///< Underlying HID Manager - IOHIDElements m_keys[Keyboard::sCodeCount]; ///< All the keys on any connected keyboard - Keyboard::Scancode m_mapping[Keyboard::KeyCount]; ///< Mapping from Key to Scancode - Keyboard::Key m_gnippam[Keyboard::sCodeCount]; ///< Mapping from Scancode to Key + IOHIDManagerRef m_manager; ///< Underlying HID Manager + IOHIDElements m_keys[Keyboard::ScanCodeCount]; ///< All the keys on any connected keyboard + Keyboard::Scancode m_keyToScancodeMapping[Keyboard::KeyCount]; ///< Mapping from Key to Scancode + Keyboard::Key m_scancodeToKeyMapping[Keyboard::ScanCodeCount]; ///< Mapping from Scancode to Key //////////////////////////////////////////////////////////// /// m_keys' index corresponds to sf::Keyboard::Scancode enum. diff --git a/src/SFML/Window/OSX/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm index ac8d2bcb..a69921ed 100644 --- a/src/SFML/Window/OSX/HIDInputManager.mm +++ b/src/SFML/Window/OSX/HIDInputManager.mm @@ -103,7 +103,7 @@ bool HIDInputManager::isKeyPressed(Keyboard::Key key) //////////////////////////////////////////////////////////// bool HIDInputManager::isKeyPressed(Keyboard::Scancode code) { - return (code != Keyboard::sUnknown) && isPressed(m_keys[code]); + return (code != Keyboard::ScanUnknown) && isPressed(m_keys[code]); } @@ -111,7 +111,7 @@ bool HIDInputManager::isKeyPressed(Keyboard::Scancode code) Keyboard::Key HIDInputManager::localize(Keyboard::Scancode code) { // TODO ensure mapping is still valid - return m_gnippam[code]; + return m_scancodeToKeyMapping[code]; } @@ -119,7 +119,7 @@ Keyboard::Key HIDInputManager::localize(Keyboard::Scancode code) Keyboard::Scancode HIDInputManager::unlocalize(Keyboard::Key key) { // TODO ensure mapping is still valid - return m_mapping[key]; + return m_keyToScancodeMapping[key]; } @@ -133,89 +133,89 @@ String HIDInputManager::localizedRepresentation(Keyboard::Scancode code) // Fallback to our best guess for the keys that are known to be independent of the layout. switch (code) { - case sf::Keyboard::sEnter: return "Enter"; - case sf::Keyboard::sEscape: return "Escape"; - case sf::Keyboard::sBackspace: return "Backspace"; - case sf::Keyboard::sTab: return "Tab"; - case sf::Keyboard::sSpace: return "Space"; + case sf::Keyboard::ScanEnter: return "Enter"; + case sf::Keyboard::ScanEscape: return "Escape"; + case sf::Keyboard::ScanBackspace: return "Backspace"; + case sf::Keyboard::ScanTab: return "Tab"; + case sf::Keyboard::ScanSpace: return "Space"; - case sf::Keyboard::sF1: return "F1"; - case sf::Keyboard::sF2: return "F2"; - case sf::Keyboard::sF3: return "F3"; - case sf::Keyboard::sF4: return "F4"; - case sf::Keyboard::sF5: return "F5"; - case sf::Keyboard::sF6: return "F6"; - case sf::Keyboard::sF7: return "F7"; - case sf::Keyboard::sF8: return "F8"; - case sf::Keyboard::sF9: return "F9"; - case sf::Keyboard::sF10: return "F10"; - case sf::Keyboard::sF11: return "F11"; - case sf::Keyboard::sF12: return "F12"; - case sf::Keyboard::sF13: return "F13"; - case sf::Keyboard::sF14: return "F14"; - case sf::Keyboard::sF15: return "F15"; + case sf::Keyboard::ScanF1: return "F1"; + case sf::Keyboard::ScanF2: return "F2"; + case sf::Keyboard::ScanF3: return "F3"; + case sf::Keyboard::ScanF4: return "F4"; + case sf::Keyboard::ScanF5: return "F5"; + case sf::Keyboard::ScanF6: return "F6"; + case sf::Keyboard::ScanF7: return "F7"; + case sf::Keyboard::ScanF8: return "F8"; + case sf::Keyboard::ScanF9: return "F9"; + case sf::Keyboard::ScanF10: return "F10"; + case sf::Keyboard::ScanF11: return "F11"; + case sf::Keyboard::ScanF12: return "F12"; + case sf::Keyboard::ScanF13: return "F13"; + case sf::Keyboard::ScanF14: return "F14"; + case sf::Keyboard::ScanF15: return "F15"; - case sf::Keyboard::sCapsLock: return "CapsLock"; - case sf::Keyboard::sPrintScreen: return "PrintScreen"; - case sf::Keyboard::sScrollLock: return "ScrollLock"; + case sf::Keyboard::ScanCapsLock: return "CapsLock"; + case sf::Keyboard::ScanPrintScreen: return "PrintScreen"; + case sf::Keyboard::ScanScrollLock: return "ScrollLock"; - case sf::Keyboard::sPause: return "Pause"; - case sf::Keyboard::sInsert: return "Insert"; - case sf::Keyboard::sHome: return "Home"; - case sf::Keyboard::sPageUp: return "PageUp"; - case sf::Keyboard::sDelete: return "Delete"; - case sf::Keyboard::sEnd: return "End"; - case sf::Keyboard::sPageDown: return "PageDown"; + case sf::Keyboard::ScanPause: return "Pause"; + case sf::Keyboard::ScanInsert: return "Insert"; + case sf::Keyboard::ScanHome: return "Home"; + case sf::Keyboard::ScanPageUp: return "PageUp"; + case sf::Keyboard::ScanDelete: return "Delete"; + case sf::Keyboard::ScanEnd: return "End"; + case sf::Keyboard::ScanPageDown: return "PageDown"; - case sf::Keyboard::sLeft: return "Left Arrow"; - case sf::Keyboard::sRight: return "Right Arrow"; - case sf::Keyboard::sDown: return "Down Arrow"; - case sf::Keyboard::sUp: return "Up Arrow"; + case sf::Keyboard::ScanLeft: return "Left Arrow"; + case sf::Keyboard::ScanRight: return "Right Arrow"; + case sf::Keyboard::ScanDown: return "Down Arrow"; + case sf::Keyboard::ScanUp: return "Up Arrow"; - case sf::Keyboard::sNumLock: return "NumLock"; - case sf::Keyboard::sDivide: return "Divide (Numpad)"; - case sf::Keyboard::sMultiply: return "Multiply (Numpad)"; - case sf::Keyboard::sMinus: return "Minux (Numpad)"; - case sf::Keyboard::sPlus: return "Plus (Numpad)"; - case sf::Keyboard::sPadEquals: return "Equals (Numpad)"; - case sf::Keyboard::sReturn: return "Return (Numpad)"; - case sf::Keyboard::sDecimal: return "Decimal (Numpad)"; + case sf::Keyboard::ScanNumLock: return "NumLock"; + case sf::Keyboard::ScanDivide: return "Divide (Numpad)"; + case sf::Keyboard::ScanMultiply: return "Multiply (Numpad)"; + case sf::Keyboard::ScanMinus: return "Minux (Numpad)"; + case sf::Keyboard::ScanPlus: return "Plus (Numpad)"; + case sf::Keyboard::ScanNumpadEquals: return "Equals (Numpad)"; + case sf::Keyboard::ScanNumpadEnter: return "Enter (Numpad)"; + case sf::Keyboard::ScanDecimal: return "Decimal (Numpad)"; - case sf::Keyboard::sNumpad0: return "0 (Numpad)"; - case sf::Keyboard::sNumpad1: return "1 (Numpad)"; - case sf::Keyboard::sNumpad2: return "2 (Numpad)"; - case sf::Keyboard::sNumpad3: return "3 (Numpad)"; - case sf::Keyboard::sNumpad4: return "4 (Numpad)"; - case sf::Keyboard::sNumpad5: return "5 (Numpad)"; - case sf::Keyboard::sNumpad6: return "6 (Numpad)"; - case sf::Keyboard::sNumpad7: return "7 (Numpad)"; - case sf::Keyboard::sNumpad8: return "8 (Numpad)"; - case sf::Keyboard::sNumpad9: return "9 (Numpad)"; + case sf::Keyboard::ScanNumpad0: return "0 (Numpad)"; + case sf::Keyboard::ScanNumpad1: return "1 (Numpad)"; + case sf::Keyboard::ScanNumpad2: return "2 (Numpad)"; + case sf::Keyboard::ScanNumpad3: return "3 (Numpad)"; + case sf::Keyboard::ScanNumpad4: return "4 (Numpad)"; + case sf::Keyboard::ScanNumpad5: return "5 (Numpad)"; + case sf::Keyboard::ScanNumpad6: return "6 (Numpad)"; + case sf::Keyboard::ScanNumpad7: return "7 (Numpad)"; + case sf::Keyboard::ScanNumpad8: return "8 (Numpad)"; + case sf::Keyboard::ScanNumpad9: return "9 (Numpad)"; - case sf::Keyboard::sApplication: return "Application"; - case sf::Keyboard::sExecute: return "Execute"; - case sf::Keyboard::sHelp: return "Help"; - case sf::Keyboard::sMenu: return "Menu"; - case sf::Keyboard::sSelect: return "Select"; - case sf::Keyboard::sStop: return "Stop"; - case sf::Keyboard::sAgain: return "Again"; - case sf::Keyboard::sUndo: return "Undo"; - case sf::Keyboard::sCut: return "Cut"; - case sf::Keyboard::sCopy: return "Copy"; - case sf::Keyboard::sPaste: return "Paste"; - case sf::Keyboard::sFind: return "Find"; - case sf::Keyboard::sMute: return "Mute"; - case sf::Keyboard::sVolumeUp: return "Volume Up"; - case sf::Keyboard::sVolumeDown: return "Volume Down"; + case sf::Keyboard::ScanApplication: return "Application"; + case sf::Keyboard::ScanExecute: return "Execute"; + case sf::Keyboard::ScanHelp: return "Help"; + case sf::Keyboard::ScanMenu: return "Menu"; + case sf::Keyboard::ScanSelect: return "Select"; + case sf::Keyboard::ScanStop: return "Stop"; + case sf::Keyboard::ScanAgain: return "Again"; + case sf::Keyboard::ScanUndo: return "Undo"; + case sf::Keyboard::ScanCut: return "Cut"; + case sf::Keyboard::ScanCopy: return "Copy"; + case sf::Keyboard::ScanPaste: return "Paste"; + case sf::Keyboard::ScanFind: return "Find"; + case sf::Keyboard::ScanMute: return "Mute"; + case sf::Keyboard::ScanVolumeUp: return "Volume Up"; + case sf::Keyboard::ScanVolumeDown: return "Volume Down"; - case sf::Keyboard::sLControl: return "Control (Left)"; - case sf::Keyboard::sLShift: return "Shift (Left)"; - case sf::Keyboard::sLAlt: return "Alt (Left)"; - case sf::Keyboard::sLSystem: return "Command (Left)"; - case sf::Keyboard::sRControl: return "Control (Right)"; - case sf::Keyboard::sRShift: return "Shift (Right)"; - case sf::Keyboard::sRAlt: return "Alt (Right)"; - case sf::Keyboard::sRSystem: return "Command (Right)"; + case sf::Keyboard::ScanLControl: return "Control (Left)"; + case sf::Keyboard::ScanLShift: return "Shift (Left)"; + case sf::Keyboard::ScanLAlt: return "Alt (Left)"; + case sf::Keyboard::ScanLSystem: return "Command (Left)"; + case sf::Keyboard::ScanRControl: return "Control (Right)"; + case sf::Keyboard::ScanRShift: return "Shift (Right)"; + case sf::Keyboard::ScanRAlt: return "Alt (Right)"; + case sf::Keyboard::ScanRSystem: return "Command (Right)"; default: return "Unknown Scancode"; // no guess good enough possible. } @@ -316,7 +316,7 @@ void HIDInputManager::loadKey(IOHIDElementRef key) { UInt32 usage = IOHIDElementGetUsage(key); sf::Keyboard::Scancode code = usageToScancode(usage); - if (code != Keyboard::sUnknown) + if (code != Keyboard::ScanUnknown) { CFRetain(key); m_keys[code].push_back(key); @@ -329,9 +329,9 @@ void HIDInputManager::buildMappings() { // Reset the mappings for (int i = 0; i < Keyboard::KeyCount; ++i) - m_mapping[i] = Keyboard::sUnknown; - for (int i = 0; i < Keyboard::sCodeCount; ++i) - m_gnippam[i] = Keyboard::Unknown; + m_keyToScancodeMapping[i] = Keyboard::ScanUnknown; + for (int i = 0; i < Keyboard::ScanCodeCount; ++i) + m_scancodeToKeyMapping[i] = Keyboard::Unknown; // Get the current keyboard layout TISInputSourceRef tis = TISCopyCurrentKeyboardLayoutInputSource(); @@ -348,7 +348,7 @@ void HIDInputManager::buildMappings() // For each scancode having a IOHIDElement, we translate the corresponding // virtual code to a localized Key. - for (int i = 0; i < Keyboard::sCodeCount; ++i) + for (int i = 0; i < Keyboard::ScanCodeCount; ++i) { Keyboard::Scancode scan = static_cast(i); UInt8 virtualCode = scanToVirtualCode(scan); @@ -380,8 +380,8 @@ void HIDInputManager::buildMappings() if (code == Keyboard::Unknown) continue; // Register the bi-mapping - m_mapping[code] = scan; - m_gnippam[scan] = code; + m_keyToScancodeMapping[code] = scan; + m_scancodeToKeyMapping[scan] = code; } CFRelease(tis); @@ -465,202 +465,202 @@ sf::Keyboard::Scancode HIDInputManager::usageToScancode(UInt32 usage) { switch (usage) { - case kHIDUsage_KeyboardErrorRollOver: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardPOSTFail: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardErrorUndefined: return sf::Keyboard::sUnknown; + case kHIDUsage_KeyboardErrorRollOver: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardPOSTFail: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardErrorUndefined: return sf::Keyboard::ScanUnknown; - case kHIDUsage_KeyboardA: return sf::Keyboard::sA; - case kHIDUsage_KeyboardB: return sf::Keyboard::sB; - case kHIDUsage_KeyboardC: return sf::Keyboard::sC; - case kHIDUsage_KeyboardD: return sf::Keyboard::sD; - case kHIDUsage_KeyboardE: return sf::Keyboard::sE; - case kHIDUsage_KeyboardF: return sf::Keyboard::sF; - case kHIDUsage_KeyboardG: return sf::Keyboard::sG; - case kHIDUsage_KeyboardH: return sf::Keyboard::sH; - case kHIDUsage_KeyboardI: return sf::Keyboard::sI; - case kHIDUsage_KeyboardJ: return sf::Keyboard::sJ; - case kHIDUsage_KeyboardK: return sf::Keyboard::sK; - case kHIDUsage_KeyboardL: return sf::Keyboard::sL; - case kHIDUsage_KeyboardM: return sf::Keyboard::sM; - case kHIDUsage_KeyboardN: return sf::Keyboard::sN; - case kHIDUsage_KeyboardO: return sf::Keyboard::sO; - case kHIDUsage_KeyboardP: return sf::Keyboard::sP; - case kHIDUsage_KeyboardQ: return sf::Keyboard::sQ; - case kHIDUsage_KeyboardR: return sf::Keyboard::sR; - case kHIDUsage_KeyboardS: return sf::Keyboard::sS; - case kHIDUsage_KeyboardT: return sf::Keyboard::sT; - case kHIDUsage_KeyboardU: return sf::Keyboard::sU; - case kHIDUsage_KeyboardV: return sf::Keyboard::sV; - case kHIDUsage_KeyboardW: return sf::Keyboard::sW; - case kHIDUsage_KeyboardX: return sf::Keyboard::sX; - case kHIDUsage_KeyboardY: return sf::Keyboard::sY; - case kHIDUsage_KeyboardZ: return sf::Keyboard::sZ; + case kHIDUsage_KeyboardA: return sf::Keyboard::ScanA; + case kHIDUsage_KeyboardB: return sf::Keyboard::ScanB; + case kHIDUsage_KeyboardC: return sf::Keyboard::ScanC; + case kHIDUsage_KeyboardD: return sf::Keyboard::ScanD; + case kHIDUsage_KeyboardE: return sf::Keyboard::ScanE; + case kHIDUsage_KeyboardF: return sf::Keyboard::ScanF; + case kHIDUsage_KeyboardG: return sf::Keyboard::ScanG; + case kHIDUsage_KeyboardH: return sf::Keyboard::ScanH; + case kHIDUsage_KeyboardI: return sf::Keyboard::ScanI; + case kHIDUsage_KeyboardJ: return sf::Keyboard::ScanJ; + case kHIDUsage_KeyboardK: return sf::Keyboard::ScanK; + case kHIDUsage_KeyboardL: return sf::Keyboard::ScanL; + case kHIDUsage_KeyboardM: return sf::Keyboard::ScanM; + case kHIDUsage_KeyboardN: return sf::Keyboard::ScanN; + case kHIDUsage_KeyboardO: return sf::Keyboard::ScanO; + case kHIDUsage_KeyboardP: return sf::Keyboard::ScanP; + case kHIDUsage_KeyboardQ: return sf::Keyboard::ScanQ; + case kHIDUsage_KeyboardR: return sf::Keyboard::ScanR; + case kHIDUsage_KeyboardS: return sf::Keyboard::ScanS; + case kHIDUsage_KeyboardT: return sf::Keyboard::ScanT; + case kHIDUsage_KeyboardU: return sf::Keyboard::ScanU; + case kHIDUsage_KeyboardV: return sf::Keyboard::ScanV; + case kHIDUsage_KeyboardW: return sf::Keyboard::ScanW; + case kHIDUsage_KeyboardX: return sf::Keyboard::ScanX; + case kHIDUsage_KeyboardY: return sf::Keyboard::ScanY; + case kHIDUsage_KeyboardZ: return sf::Keyboard::ScanZ; - case kHIDUsage_Keyboard1: return sf::Keyboard::sNum1; - case kHIDUsage_Keyboard2: return sf::Keyboard::sNum2; - case kHIDUsage_Keyboard3: return sf::Keyboard::sNum3; - case kHIDUsage_Keyboard4: return sf::Keyboard::sNum4; - case kHIDUsage_Keyboard5: return sf::Keyboard::sNum5; - case kHIDUsage_Keyboard6: return sf::Keyboard::sNum6; - case kHIDUsage_Keyboard7: return sf::Keyboard::sNum7; - case kHIDUsage_Keyboard8: return sf::Keyboard::sNum8; - case kHIDUsage_Keyboard9: return sf::Keyboard::sNum9; - case kHIDUsage_Keyboard0: return sf::Keyboard::sNum0; + case kHIDUsage_Keyboard1: return sf::Keyboard::ScanNum1; + case kHIDUsage_Keyboard2: return sf::Keyboard::ScanNum2; + case kHIDUsage_Keyboard3: return sf::Keyboard::ScanNum3; + case kHIDUsage_Keyboard4: return sf::Keyboard::ScanNum4; + case kHIDUsage_Keyboard5: return sf::Keyboard::ScanNum5; + case kHIDUsage_Keyboard6: return sf::Keyboard::ScanNum6; + case kHIDUsage_Keyboard7: return sf::Keyboard::ScanNum7; + case kHIDUsage_Keyboard8: return sf::Keyboard::ScanNum8; + case kHIDUsage_Keyboard9: return sf::Keyboard::ScanNum9; + case kHIDUsage_Keyboard0: return sf::Keyboard::ScanNum0; - case kHIDUsage_KeyboardReturnOrEnter: return sf::Keyboard::sEnter; - case kHIDUsage_KeyboardEscape: return sf::Keyboard::sEscape; - case kHIDUsage_KeyboardDeleteOrBackspace: return sf::Keyboard::sBackspace; - case kHIDUsage_KeyboardTab: return sf::Keyboard::sTab; - case kHIDUsage_KeyboardSpacebar: return sf::Keyboard::sSpace; - case kHIDUsage_KeyboardHyphen: return sf::Keyboard::sHyphen; - case kHIDUsage_KeyboardEqualSign: return sf::Keyboard::sEquals; - case kHIDUsage_KeyboardOpenBracket: return sf::Keyboard::sLBracket; - case kHIDUsage_KeyboardCloseBracket: return sf::Keyboard::sRBracket; - case kHIDUsage_KeyboardBackslash: return sf::Keyboard::sBackslash; - case kHIDUsage_KeyboardNonUSPound: return sf::Keyboard::sDash; - case kHIDUsage_KeyboardSemicolon: return sf::Keyboard::sSemicolon; - case kHIDUsage_KeyboardQuote: return sf::Keyboard::sQuote; - case kHIDUsage_KeyboardGraveAccentAndTilde: return sf::Keyboard::sGraveAccent; - case kHIDUsage_KeyboardComma: return sf::Keyboard::sComma; - case kHIDUsage_KeyboardPeriod: return sf::Keyboard::sPeriod; - case kHIDUsage_KeyboardSlash: return sf::Keyboard::sForwardSlash; - case kHIDUsage_KeyboardCapsLock: return sf::Keyboard::sCapsLock; + case kHIDUsage_KeyboardReturnOrEnter: return sf::Keyboard::ScanEnter; + case kHIDUsage_KeyboardEscape: return sf::Keyboard::ScanEscape; + case kHIDUsage_KeyboardDeleteOrBackspace: return sf::Keyboard::ScanBackspace; + case kHIDUsage_KeyboardTab: return sf::Keyboard::ScanTab; + case kHIDUsage_KeyboardSpacebar: return sf::Keyboard::ScanSpace; + case kHIDUsage_KeyboardHyphen: return sf::Keyboard::ScanHyphen; + case kHIDUsage_KeyboardEqualSign: return sf::Keyboard::ScanEquals; + case kHIDUsage_KeyboardOpenBracket: return sf::Keyboard::ScanLBracket; + case kHIDUsage_KeyboardCloseBracket: return sf::Keyboard::ScanRBracket; + case kHIDUsage_KeyboardBackslash: return sf::Keyboard::ScanBackslash; + case kHIDUsage_KeyboardNonUSPound: return sf::Keyboard::ScanDash; + case kHIDUsage_KeyboardSemicolon: return sf::Keyboard::ScanSemicolon; + case kHIDUsage_KeyboardQuote: return sf::Keyboard::ScanQuote; + case kHIDUsage_KeyboardGraveAccentAndTilde: return sf::Keyboard::ScanGraveAccent; + case kHIDUsage_KeyboardComma: return sf::Keyboard::ScanComma; + case kHIDUsage_KeyboardPeriod: return sf::Keyboard::ScanPeriod; + case kHIDUsage_KeyboardSlash: return sf::Keyboard::ScanSlash; + case kHIDUsage_KeyboardCapsLock: return sf::Keyboard::ScanCapsLock; - case kHIDUsage_KeyboardF1: return sf::Keyboard::sF1; - case kHIDUsage_KeyboardF2: return sf::Keyboard::sF2; - case kHIDUsage_KeyboardF3: return sf::Keyboard::sF3; - case kHIDUsage_KeyboardF4: return sf::Keyboard::sF4; - case kHIDUsage_KeyboardF5: return sf::Keyboard::sF5; - case kHIDUsage_KeyboardF6: return sf::Keyboard::sF6; - case kHIDUsage_KeyboardF7: return sf::Keyboard::sF7; - case kHIDUsage_KeyboardF8: return sf::Keyboard::sF8; - case kHIDUsage_KeyboardF9: return sf::Keyboard::sF9; - case kHIDUsage_KeyboardF10: return sf::Keyboard::sF10; - case kHIDUsage_KeyboardF11: return sf::Keyboard::sF11; - case kHIDUsage_KeyboardF12: return sf::Keyboard::sF12; + case kHIDUsage_KeyboardF1: return sf::Keyboard::ScanF1; + case kHIDUsage_KeyboardF2: return sf::Keyboard::ScanF2; + case kHIDUsage_KeyboardF3: return sf::Keyboard::ScanF3; + case kHIDUsage_KeyboardF4: return sf::Keyboard::ScanF4; + case kHIDUsage_KeyboardF5: return sf::Keyboard::ScanF5; + case kHIDUsage_KeyboardF6: return sf::Keyboard::ScanF6; + case kHIDUsage_KeyboardF7: return sf::Keyboard::ScanF7; + case kHIDUsage_KeyboardF8: return sf::Keyboard::ScanF8; + case kHIDUsage_KeyboardF9: return sf::Keyboard::ScanF9; + case kHIDUsage_KeyboardF10: return sf::Keyboard::ScanF10; + case kHIDUsage_KeyboardF11: return sf::Keyboard::ScanF11; + case kHIDUsage_KeyboardF12: return sf::Keyboard::ScanF12; - case kHIDUsage_KeyboardPrintScreen: return sf::Keyboard::sPrintScreen; - case kHIDUsage_KeyboardScrollLock: return sf::Keyboard::sScrollLock; - case kHIDUsage_KeyboardPause: return sf::Keyboard::sPause; - case kHIDUsage_KeyboardInsert: return sf::Keyboard::sInsert; - case kHIDUsage_KeyboardHome: return sf::Keyboard::sHome; - case kHIDUsage_KeyboardPageUp: return sf::Keyboard::sPageUp; - case kHIDUsage_KeyboardDeleteForward: return sf::Keyboard::sDelete; - case kHIDUsage_KeyboardEnd: return sf::Keyboard::sEnd; - case kHIDUsage_KeyboardPageDown: return sf::Keyboard::sPageDown; + case kHIDUsage_KeyboardPrintScreen: return sf::Keyboard::ScanPrintScreen; + case kHIDUsage_KeyboardScrollLock: return sf::Keyboard::ScanScrollLock; + case kHIDUsage_KeyboardPause: return sf::Keyboard::ScanPause; + case kHIDUsage_KeyboardInsert: return sf::Keyboard::ScanInsert; + case kHIDUsage_KeyboardHome: return sf::Keyboard::ScanHome; + case kHIDUsage_KeyboardPageUp: return sf::Keyboard::ScanPageUp; + case kHIDUsage_KeyboardDeleteForward: return sf::Keyboard::ScanDelete; + case kHIDUsage_KeyboardEnd: return sf::Keyboard::ScanEnd; + case kHIDUsage_KeyboardPageDown: return sf::Keyboard::ScanPageDown; - case kHIDUsage_KeyboardRightArrow: return sf::Keyboard::sRight; - case kHIDUsage_KeyboardLeftArrow: return sf::Keyboard::sLeft; - case kHIDUsage_KeyboardDownArrow: return sf::Keyboard::sDown; - case kHIDUsage_KeyboardUpArrow: return sf::Keyboard::sUp; + case kHIDUsage_KeyboardRightArrow: return sf::Keyboard::ScanRight; + case kHIDUsage_KeyboardLeftArrow: return sf::Keyboard::ScanLeft; + case kHIDUsage_KeyboardDownArrow: return sf::Keyboard::ScanDown; + case kHIDUsage_KeyboardUpArrow: return sf::Keyboard::ScanUp; - case kHIDUsage_KeypadNumLock: return sf::Keyboard::sNumLock; - case kHIDUsage_KeypadSlash: return sf::Keyboard::sDivide; - case kHIDUsage_KeypadAsterisk: return sf::Keyboard::sMultiply; - case kHIDUsage_KeypadHyphen: return sf::Keyboard::sMinus; - case kHIDUsage_KeypadPlus: return sf::Keyboard::sPlus; - case kHIDUsage_KeypadEnter: return sf::Keyboard::sReturn; + case kHIDUsage_KeypadNumLock: return sf::Keyboard::ScanNumLock; + case kHIDUsage_KeypadSlash: return sf::Keyboard::ScanDivide; + case kHIDUsage_KeypadAsterisk: return sf::Keyboard::ScanMultiply; + case kHIDUsage_KeypadHyphen: return sf::Keyboard::ScanMinus; + case kHIDUsage_KeypadPlus: return sf::Keyboard::ScanPlus; + case kHIDUsage_KeypadEnter: return sf::Keyboard::ScanEnter; - case kHIDUsage_Keypad1: return sf::Keyboard::sNumpad1; - case kHIDUsage_Keypad2: return sf::Keyboard::sNumpad2; - case kHIDUsage_Keypad3: return sf::Keyboard::sNumpad3; - case kHIDUsage_Keypad4: return sf::Keyboard::sNumpad4; - case kHIDUsage_Keypad5: return sf::Keyboard::sNumpad5; - case kHIDUsage_Keypad6: return sf::Keyboard::sNumpad6; - case kHIDUsage_Keypad7: return sf::Keyboard::sNumpad7; - case kHIDUsage_Keypad8: return sf::Keyboard::sNumpad8; - case kHIDUsage_Keypad9: return sf::Keyboard::sNumpad9; - case kHIDUsage_Keypad0: return sf::Keyboard::sNumpad0; + case kHIDUsage_Keypad1: return sf::Keyboard::ScanNumpad1; + case kHIDUsage_Keypad2: return sf::Keyboard::ScanNumpad2; + case kHIDUsage_Keypad3: return sf::Keyboard::ScanNumpad3; + case kHIDUsage_Keypad4: return sf::Keyboard::ScanNumpad4; + case kHIDUsage_Keypad5: return sf::Keyboard::ScanNumpad5; + case kHIDUsage_Keypad6: return sf::Keyboard::ScanNumpad6; + case kHIDUsage_Keypad7: return sf::Keyboard::ScanNumpad7; + case kHIDUsage_Keypad8: return sf::Keyboard::ScanNumpad8; + case kHIDUsage_Keypad9: return sf::Keyboard::ScanNumpad9; + case kHIDUsage_Keypad0: return sf::Keyboard::ScanNumpad0; - case kHIDUsage_KeypadPeriod: return sf::Keyboard::sDecimal; - case kHIDUsage_KeyboardNonUSBackslash: return sf::Keyboard::sReverseSolidus; - case kHIDUsage_KeyboardApplication: return sf::Keyboard::sApplication; - case kHIDUsage_KeyboardPower: return sf::Keyboard::sUnknown; - case kHIDUsage_KeypadEqualSign: return sf::Keyboard::sPadEquals; + case kHIDUsage_KeypadPeriod: return sf::Keyboard::ScanDecimal; + case kHIDUsage_KeyboardNonUSBackslash: return sf::Keyboard::ScanReverseSolidus; + case kHIDUsage_KeyboardApplication: return sf::Keyboard::ScanApplication; + case kHIDUsage_KeyboardPower: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeypadEqualSign: return sf::Keyboard::ScanNumpadEquals; - case kHIDUsage_KeyboardF13: return sf::Keyboard::sF13; - case kHIDUsage_KeyboardF14: return sf::Keyboard::sF14; - case kHIDUsage_KeyboardF15: return sf::Keyboard::sF15; - case kHIDUsage_KeyboardF16: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF17: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF18: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF19: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF20: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF21: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF22: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF23: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardF24: return sf::Keyboard::sUnknown; + case kHIDUsage_KeyboardF13: return sf::Keyboard::ScanF13; + case kHIDUsage_KeyboardF14: return sf::Keyboard::ScanF14; + case kHIDUsage_KeyboardF15: return sf::Keyboard::ScanF15; + case kHIDUsage_KeyboardF16: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF17: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF18: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF19: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF20: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF21: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF22: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF23: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardF24: return sf::Keyboard::ScanUnknown; - case kHIDUsage_KeyboardExecute: return sf::Keyboard::sExecute; - case kHIDUsage_KeyboardHelp: return sf::Keyboard::sHelp; - case kHIDUsage_KeyboardMenu: return sf::Keyboard::sMenu; - case kHIDUsage_KeyboardSelect: return sf::Keyboard::sSelect; - case kHIDUsage_KeyboardStop: return sf::Keyboard::sStop; - case kHIDUsage_KeyboardAgain: return sf::Keyboard::sAgain; - case kHIDUsage_KeyboardUndo: return sf::Keyboard::sUndo; - case kHIDUsage_KeyboardCut: return sf::Keyboard::sCut; - case kHIDUsage_KeyboardCopy: return sf::Keyboard::sCopy; - case kHIDUsage_KeyboardPaste: return sf::Keyboard::sPaste; - case kHIDUsage_KeyboardFind: return sf::Keyboard::sFind; + case kHIDUsage_KeyboardExecute: return sf::Keyboard::ScanExecute; + case kHIDUsage_KeyboardHelp: return sf::Keyboard::ScanHelp; + case kHIDUsage_KeyboardMenu: return sf::Keyboard::ScanMenu; + case kHIDUsage_KeyboardSelect: return sf::Keyboard::ScanSelect; + case kHIDUsage_KeyboardStop: return sf::Keyboard::ScanStop; + case kHIDUsage_KeyboardAgain: return sf::Keyboard::ScanAgain; + case kHIDUsage_KeyboardUndo: return sf::Keyboard::ScanUndo; + case kHIDUsage_KeyboardCut: return sf::Keyboard::ScanCut; + case kHIDUsage_KeyboardCopy: return sf::Keyboard::ScanCopy; + case kHIDUsage_KeyboardPaste: return sf::Keyboard::ScanPaste; + case kHIDUsage_KeyboardFind: return sf::Keyboard::ScanFind; - case kHIDUsage_KeyboardMute: return sf::Keyboard::sMute; - case kHIDUsage_KeyboardVolumeUp: return sf::Keyboard::sVolumeUp; - case kHIDUsage_KeyboardVolumeDown: return sf::Keyboard::sVolumeDown; + case kHIDUsage_KeyboardMute: return sf::Keyboard::ScanMute; + case kHIDUsage_KeyboardVolumeUp: return sf::Keyboard::ScanVolumeUp; + case kHIDUsage_KeyboardVolumeDown: return sf::Keyboard::ScanVolumeDown; - case kHIDUsage_KeyboardLockingCapsLock: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLockingNumLock: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLockingScrollLock: return sf::Keyboard::sUnknown; + case kHIDUsage_KeyboardLockingCapsLock: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLockingNumLock: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLockingScrollLock: return sf::Keyboard::ScanUnknown; - case kHIDUsage_KeypadComma: return sf::Keyboard::sUnknown; - case kHIDUsage_KeypadEqualSignAS400: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational1: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational2: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational3: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational4: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational5: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational6: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational7: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational8: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardInternational9: return sf::Keyboard::sUnknown; + case kHIDUsage_KeypadComma: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeypadEqualSignAS400: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational1: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational2: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational3: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational4: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational5: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational6: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational7: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational8: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardInternational9: return sf::Keyboard::ScanUnknown; - case kHIDUsage_KeyboardLANG1: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG2: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG3: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG4: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG5: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG6: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG7: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG8: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardLANG9: return sf::Keyboard::sUnknown; + case kHIDUsage_KeyboardLANG1: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG2: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG3: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG4: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG5: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG6: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG7: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG8: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardLANG9: return sf::Keyboard::ScanUnknown; - case kHIDUsage_KeyboardAlternateErase: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardSysReqOrAttention: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardCancel: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardClear: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardPrior: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardReturn: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardSeparator: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardOut: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardOper: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardClearOrAgain: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardCrSelOrProps: return sf::Keyboard::sUnknown; - case kHIDUsage_KeyboardExSel: return sf::Keyboard::sUnknown; + case kHIDUsage_KeyboardAlternateErase: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardSysReqOrAttention: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardCancel: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardClear: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardPrior: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardReturn: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardSeparator: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardOut: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardOper: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardClearOrAgain: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardCrSelOrProps: return sf::Keyboard::ScanUnknown; + case kHIDUsage_KeyboardExSel: return sf::Keyboard::ScanUnknown; /* 0xa5-0xdf Reserved */ - case kHIDUsage_KeyboardLeftControl: return sf::Keyboard::sLControl; - case kHIDUsage_KeyboardLeftShift: return sf::Keyboard::sLShift; - case kHIDUsage_KeyboardLeftAlt: return sf::Keyboard::sLAlt; - case kHIDUsage_KeyboardLeftGUI: return sf::Keyboard::sLSystem; - case kHIDUsage_KeyboardRightControl: return sf::Keyboard::sRControl; - case kHIDUsage_KeyboardRightShift: return sf::Keyboard::sRShift; - case kHIDUsage_KeyboardRightAlt: return sf::Keyboard::sRAlt; - case kHIDUsage_KeyboardRightGUI: return sf::Keyboard::sRSystem; + case kHIDUsage_KeyboardLeftControl: return sf::Keyboard::ScanLControl; + case kHIDUsage_KeyboardLeftShift: return sf::Keyboard::ScanLShift; + case kHIDUsage_KeyboardLeftAlt: return sf::Keyboard::ScanLAlt; + case kHIDUsage_KeyboardLeftGUI: return sf::Keyboard::ScanLSystem; + case kHIDUsage_KeyboardRightControl: return sf::Keyboard::ScanRControl; + case kHIDUsage_KeyboardRightShift: return sf::Keyboard::ScanRShift; + case kHIDUsage_KeyboardRightAlt: return sf::Keyboard::ScanRAlt; + case kHIDUsage_KeyboardRightGUI: return sf::Keyboard::ScanRSystem; /* 0xe8-0xffff Reserved */ - case kHIDUsage_Keyboard_Reserved: return sf::Keyboard::sUnknown; - default: return sf::Keyboard::sUnknown; + case kHIDUsage_Keyboard_Reserved: return sf::Keyboard::ScanUnknown; + default: return sf::Keyboard::ScanUnknown; } } @@ -672,147 +672,147 @@ Keyboard::Key HIDInputManager::localizedKey(UniChar ch) // Otherwise one can refer to the usual Unicode table. switch (ch) { - case 0x41: return sf::Keyboard::A; // uppercase A - case 0x42: return sf::Keyboard::B; - case 0x43: return sf::Keyboard::C; - case 0x44: return sf::Keyboard::D; - case 0x45: return sf::Keyboard::E; - case 0x46: return sf::Keyboard::F; - case 0x47: return sf::Keyboard::G; - case 0x48: return sf::Keyboard::H; - case 0x49: return sf::Keyboard::I; - case 0x4a: return sf::Keyboard::J; - case 0x4b: return sf::Keyboard::K; - case 0x4c: return sf::Keyboard::L; - case 0x4d: return sf::Keyboard::M; - case 0x4e: return sf::Keyboard::N; - case 0x4f: return sf::Keyboard::O; - case 0x50: return sf::Keyboard::P; - case 0x51: return sf::Keyboard::Q; - case 0x52: return sf::Keyboard::R; - case 0x53: return sf::Keyboard::S; - case 0x54: return sf::Keyboard::T; - case 0x55: return sf::Keyboard::U; - case 0x56: return sf::Keyboard::V; - case 0x57: return sf::Keyboard::W; - case 0x58: return sf::Keyboard::X; - case 0x59: return sf::Keyboard::Y; + case 0x41: return sf::Keyboard::A; // uppercase A + case 0x42: return sf::Keyboard::B; + case 0x43: return sf::Keyboard::C; + case 0x44: return sf::Keyboard::D; + case 0x45: return sf::Keyboard::E; + case 0x46: return sf::Keyboard::F; + case 0x47: return sf::Keyboard::G; + case 0x48: return sf::Keyboard::H; + case 0x49: return sf::Keyboard::I; + case 0x4a: return sf::Keyboard::J; + case 0x4b: return sf::Keyboard::K; + case 0x4c: return sf::Keyboard::L; + case 0x4d: return sf::Keyboard::M; + case 0x4e: return sf::Keyboard::N; + case 0x4f: return sf::Keyboard::O; + case 0x50: return sf::Keyboard::P; + case 0x51: return sf::Keyboard::Q; + case 0x52: return sf::Keyboard::R; + case 0x53: return sf::Keyboard::S; + case 0x54: return sf::Keyboard::T; + case 0x55: return sf::Keyboard::U; + case 0x56: return sf::Keyboard::V; + case 0x57: return sf::Keyboard::W; + case 0x58: return sf::Keyboard::X; + case 0x59: return sf::Keyboard::Y; - case 0x5a: return sf::Keyboard::Z; // lowercase A - case 0x61: return sf::Keyboard::A; - case 0x62: return sf::Keyboard::B; - case 0x63: return sf::Keyboard::C; - case 0x64: return sf::Keyboard::D; - case 0x65: return sf::Keyboard::E; - case 0x66: return sf::Keyboard::F; - case 0x67: return sf::Keyboard::G; - case 0x68: return sf::Keyboard::H; - case 0x69: return sf::Keyboard::I; - case 0x6a: return sf::Keyboard::J; - case 0x6b: return sf::Keyboard::K; - case 0x6c: return sf::Keyboard::L; - case 0x6d: return sf::Keyboard::M; - case 0x6e: return sf::Keyboard::N; - case 0x6f: return sf::Keyboard::O; - case 0x70: return sf::Keyboard::P; - case 0x71: return sf::Keyboard::Q; - case 0x72: return sf::Keyboard::R; - case 0x73: return sf::Keyboard::S; - case 0x74: return sf::Keyboard::T; - case 0x75: return sf::Keyboard::U; - case 0x76: return sf::Keyboard::V; - case 0x77: return sf::Keyboard::W; - case 0x78: return sf::Keyboard::X; - case 0x79: return sf::Keyboard::Y; - case 0x7a: return sf::Keyboard::Z; + case 0x5a: return sf::Keyboard::Z; // lowercase A + case 0x61: return sf::Keyboard::A; + case 0x62: return sf::Keyboard::B; + case 0x63: return sf::Keyboard::C; + case 0x64: return sf::Keyboard::D; + case 0x65: return sf::Keyboard::E; + case 0x66: return sf::Keyboard::F; + case 0x67: return sf::Keyboard::G; + case 0x68: return sf::Keyboard::H; + case 0x69: return sf::Keyboard::I; + case 0x6a: return sf::Keyboard::J; + case 0x6b: return sf::Keyboard::K; + case 0x6c: return sf::Keyboard::L; + case 0x6d: return sf::Keyboard::M; + case 0x6e: return sf::Keyboard::N; + case 0x6f: return sf::Keyboard::O; + case 0x70: return sf::Keyboard::P; + case 0x71: return sf::Keyboard::Q; + case 0x72: return sf::Keyboard::R; + case 0x73: return sf::Keyboard::S; + case 0x74: return sf::Keyboard::T; + case 0x75: return sf::Keyboard::U; + case 0x76: return sf::Keyboard::V; + case 0x77: return sf::Keyboard::W; + case 0x78: return sf::Keyboard::X; + case 0x79: return sf::Keyboard::Y; + case 0x7a: return sf::Keyboard::Z; - case 0x30: return sf::Keyboard::Num0; - case 0x31: return sf::Keyboard::Num1; - case 0x32: return sf::Keyboard::Num2; - case 0x33: return sf::Keyboard::Num3; - case 0x34: return sf::Keyboard::Num4; - case 0x35: return sf::Keyboard::Num5; - case 0x36: return sf::Keyboard::Num6; - case 0x37: return sf::Keyboard::Num7; - case 0x38: return sf::Keyboard::Num8; - case 0x39: return sf::Keyboard::Num9; + case 0x30: return sf::Keyboard::Num0; + case 0x31: return sf::Keyboard::Num1; + case 0x32: return sf::Keyboard::Num2; + case 0x33: return sf::Keyboard::Num3; + case 0x34: return sf::Keyboard::Num4; + case 0x35: return sf::Keyboard::Num5; + case 0x36: return sf::Keyboard::Num6; + case 0x37: return sf::Keyboard::Num7; + case 0x38: return sf::Keyboard::Num8; + case 0x39: return sf::Keyboard::Num9; - case 0x1b: return sf::Keyboard::Escape; + case 0x1b: return sf::Keyboard::Escape; /* Those are not represented using Unicode. - * case 0x: return sf::Keyboard::LControl; - * case 0x: return sf::Keyboard::LShift; - * case 0x: return sf::Keyboard::LAlt; - * case 0x: return sf::Keyboard::LSystem; - * case 0x: return sf::Keyboard::RControl; - * case 0x: return sf::Keyboard::RShift; - * case 0x: return sf::Keyboard::RAlt; - * case 0x: return sf::Keyboard::RSystem; + * case 0x: return sf::Keyboard::LControl; + * case 0x: return sf::Keyboard::LShift; + * case 0x: return sf::Keyboard::LAlt; + * case 0x: return sf::Keyboard::LSystem; + * case 0x: return sf::Keyboard::RControl; + * case 0x: return sf::Keyboard::RShift; + * case 0x: return sf::Keyboard::RAlt; + * case 0x: return sf::Keyboard::RSystem; */ - case NSMenuFunctionKey: return sf::Keyboard::Menu; + case NSMenuFunctionKey: return sf::Keyboard::Menu; - case 0x5b: return sf::Keyboard::LBracket; - case 0x5d: return sf::Keyboard::RBracket; - case 0x3b: return sf::Keyboard::SemiColon; - case 0x2c: return sf::Keyboard::Comma; - case 0x2e: return sf::Keyboard::Period; - case 0x27: return sf::Keyboard::Quote; - case 0x2044: return sf::Keyboard::Slash; // 0x2f is Divide - case 0x5c: return sf::Keyboard::BackSlash; - case 0x7e: return sf::Keyboard::Tilde; - case 0x3d: return sf::Keyboard::Equal; - case 0x2013: return sf::Keyboard::Dash; // 0x2d is Subtract - case 0x20: return sf::Keyboard::Space; - case 0x0d: return sf::Keyboard::Return; - case 0x7f: return sf::Keyboard::BackSpace; // NOTE backspace & delete are swapped on Mac. - case 0x09: return sf::Keyboard::Tab; + case 0x5b: return sf::Keyboard::LBracket; + case 0x5d: return sf::Keyboard::RBracket; + case 0x3b: return sf::Keyboard::SemiColon; + case 0x2c: return sf::Keyboard::Comma; + case 0x2e: return sf::Keyboard::Period; + case 0x27: return sf::Keyboard::Quote; + case 0x2044: return sf::Keyboard::Slash; // 0x2f is Divide + case 0x5c: return sf::Keyboard::BackSlash; + case 0x7e: return sf::Keyboard::Tilde; + case 0x3d: return sf::Keyboard::Equal; + case 0x2013: return sf::Keyboard::Dash; // 0x2d is Subtract + case 0x20: return sf::Keyboard::Space; + case 0x0d: return sf::Keyboard::Return; + case 0x7f: return sf::Keyboard::BackSpace; // NOTE backspace & delete are swapped on Mac. + case 0x09: return sf::Keyboard::Tab; - case NSPageUpFunctionKey: return sf::Keyboard::PageUp; - case NSPageDownFunctionKey: return sf::Keyboard::PageDown; - case NSEndFunctionKey: return sf::Keyboard::End; - case NSHomeFunctionKey: return sf::Keyboard::Home; - case NSInsertFunctionKey: return sf::Keyboard::Insert; - case NSDeleteFunctionKey: return sf::Keyboard::Delete; + case NSPageUpFunctionKey: return sf::Keyboard::PageUp; + case NSPageDownFunctionKey: return sf::Keyboard::PageDown; + case NSEndFunctionKey: return sf::Keyboard::End; + case NSHomeFunctionKey: return sf::Keyboard::Home; + case NSInsertFunctionKey: return sf::Keyboard::Insert; + case NSDeleteFunctionKey: return sf::Keyboard::Delete; - case 0x2b: return sf::Keyboard::Add; - case 0x2d: return sf::Keyboard::Subtract; - case 0x2a: return sf::Keyboard::Multiply; - case 0x2f: return sf::Keyboard::Divide; + case 0x2b: return sf::Keyboard::Add; + case 0x2d: return sf::Keyboard::Subtract; + case 0x2a: return sf::Keyboard::Multiply; + case 0x2f: return sf::Keyboard::Divide; - case NSLeftArrowFunctionKey: return sf::Keyboard::Left; - case NSRightArrowFunctionKey: return sf::Keyboard::Right; - case NSUpArrowFunctionKey: return sf::Keyboard::Up; - case NSDownArrowFunctionKey: return sf::Keyboard::Down; + case NSLeftArrowFunctionKey: return sf::Keyboard::Left; + case NSRightArrowFunctionKey: return sf::Keyboard::Right; + case NSUpArrowFunctionKey: return sf::Keyboard::Up; + case NSDownArrowFunctionKey: return sf::Keyboard::Down; /* Those are not represented using Unicode. - * case 0x: return sf::Keyboard::Numpad0; - * case 0x: return sf::Keyboard::Numpad1; - * case 0x: return sf::Keyboard::Numpad2; - * case 0x: return sf::Keyboard::Numpad3; - * case 0x: return sf::Keyboard::Numpad4; - * case 0x: return sf::Keyboard::Numpad5; - * case 0x: return sf::Keyboard::Numpad6; - * case 0x: return sf::Keyboard::Numpad7; - * case 0x: return sf::Keyboard::Numpad8; - * case 0x: return sf::Keyboard::Numpad9; + * case 0x: return sf::Keyboard::Numpad0; + * case 0x: return sf::Keyboard::Numpad1; + * case 0x: return sf::Keyboard::Numpad2; + * case 0x: return sf::Keyboard::Numpad3; + * case 0x: return sf::Keyboard::Numpad4; + * case 0x: return sf::Keyboard::Numpad5; + * case 0x: return sf::Keyboard::Numpad6; + * case 0x: return sf::Keyboard::Numpad7; + * case 0x: return sf::Keyboard::Numpad8; + * case 0x: return sf::Keyboard::Numpad9; */ - case NSF1FunctionKey: return sf::Keyboard::F1; - case NSF2FunctionKey: return sf::Keyboard::F2; - case NSF3FunctionKey: return sf::Keyboard::F3; - case NSF4FunctionKey: return sf::Keyboard::F4; - case NSF5FunctionKey: return sf::Keyboard::F5; - case NSF6FunctionKey: return sf::Keyboard::F6; - case NSF7FunctionKey: return sf::Keyboard::F7; - case NSF8FunctionKey: return sf::Keyboard::F8; - case NSF9FunctionKey: return sf::Keyboard::F9; - case NSF10FunctionKey: return sf::Keyboard::F10; - case NSF11FunctionKey: return sf::Keyboard::F11; - case NSF12FunctionKey: return sf::Keyboard::F12; - case NSF13FunctionKey: return sf::Keyboard::F13; - case NSF14FunctionKey: return sf::Keyboard::F14; - case NSF15FunctionKey: return sf::Keyboard::F15; + case NSF1FunctionKey: return sf::Keyboard::F1; + case NSF2FunctionKey: return sf::Keyboard::F2; + case NSF3FunctionKey: return sf::Keyboard::F3; + case NSF4FunctionKey: return sf::Keyboard::F4; + case NSF5FunctionKey: return sf::Keyboard::F5; + case NSF6FunctionKey: return sf::Keyboard::F6; + case NSF7FunctionKey: return sf::Keyboard::F7; + case NSF8FunctionKey: return sf::Keyboard::F8; + case NSF9FunctionKey: return sf::Keyboard::F9; + case NSF10FunctionKey: return sf::Keyboard::F10; + case NSF11FunctionKey: return sf::Keyboard::F11; + case NSF12FunctionKey: return sf::Keyboard::F12; + case NSF13FunctionKey: return sf::Keyboard::F13; + case NSF14FunctionKey: return sf::Keyboard::F14; + case NSF15FunctionKey: return sf::Keyboard::F15; case NSPauseFunctionKey: return sf::Keyboard::Pause; @@ -826,124 +826,124 @@ UniChar HIDInputManager::toUnicode(Keyboard::Key key) { switch (key) { - case sf::Keyboard::A: return 0x41; - case sf::Keyboard::B: return 0x42; - case sf::Keyboard::C: return 0x43; - case sf::Keyboard::D: return 0x44; - case sf::Keyboard::E: return 0x45; - case sf::Keyboard::F: return 0x46; - case sf::Keyboard::G: return 0x47; - case sf::Keyboard::H: return 0x48; - case sf::Keyboard::I: return 0x49; - case sf::Keyboard::J: return 0x4a; - case sf::Keyboard::K: return 0x4b; - case sf::Keyboard::L: return 0x4c; - case sf::Keyboard::M: return 0x4d; - case sf::Keyboard::N: return 0x4e; - case sf::Keyboard::O: return 0x4f; - case sf::Keyboard::P: return 0x50; - case sf::Keyboard::Q: return 0x51; - case sf::Keyboard::R: return 0x52; - case sf::Keyboard::S: return 0x53; - case sf::Keyboard::T: return 0x54; - case sf::Keyboard::U: return 0x55; - case sf::Keyboard::V: return 0x56; - case sf::Keyboard::W: return 0x57; - case sf::Keyboard::X: return 0x58; - case sf::Keyboard::Y: return 0x59; - case sf::Keyboard::Z: return 0x5a; + case sf::Keyboard::A: return 0x41; + case sf::Keyboard::B: return 0x42; + case sf::Keyboard::C: return 0x43; + case sf::Keyboard::D: return 0x44; + case sf::Keyboard::E: return 0x45; + case sf::Keyboard::F: return 0x46; + case sf::Keyboard::G: return 0x47; + case sf::Keyboard::H: return 0x48; + case sf::Keyboard::I: return 0x49; + case sf::Keyboard::J: return 0x4a; + case sf::Keyboard::K: return 0x4b; + case sf::Keyboard::L: return 0x4c; + case sf::Keyboard::M: return 0x4d; + case sf::Keyboard::N: return 0x4e; + case sf::Keyboard::O: return 0x4f; + case sf::Keyboard::P: return 0x50; + case sf::Keyboard::Q: return 0x51; + case sf::Keyboard::R: return 0x52; + case sf::Keyboard::S: return 0x53; + case sf::Keyboard::T: return 0x54; + case sf::Keyboard::U: return 0x55; + case sf::Keyboard::V: return 0x56; + case sf::Keyboard::W: return 0x57; + case sf::Keyboard::X: return 0x58; + case sf::Keyboard::Y: return 0x59; + case sf::Keyboard::Z: return 0x5a; - case sf::Keyboard::Num0: return 0x30; - case sf::Keyboard::Num1: return 0x31; - case sf::Keyboard::Num2: return 0x32; - case sf::Keyboard::Num3: return 0x33; - case sf::Keyboard::Num4: return 0x34; - case sf::Keyboard::Num5: return 0x35; - case sf::Keyboard::Num6: return 0x36; - case sf::Keyboard::Num7: return 0x37; - case sf::Keyboard::Num8: return 0x38; - case sf::Keyboard::Num9: return 0x39; + case sf::Keyboard::Num0: return 0x30; + case sf::Keyboard::Num1: return 0x31; + case sf::Keyboard::Num2: return 0x32; + case sf::Keyboard::Num3: return 0x33; + case sf::Keyboard::Num4: return 0x34; + case sf::Keyboard::Num5: return 0x35; + case sf::Keyboard::Num6: return 0x36; + case sf::Keyboard::Num7: return 0x37; + case sf::Keyboard::Num8: return 0x38; + case sf::Keyboard::Num9: return 0x39; case sf::Keyboard::Escape: return 0x1b; /* Not representable as Unicode: - * case sf::Keyboard::LControl: return 0x; - * case sf::Keyboard::LShift: return 0x; - * case sf::Keyboard::LAlt: return 0x; - * case sf::Keyboard::LSystem: return 0x; - * case sf::Keyboard::RControl: return 0x; - * case sf::Keyboard::RShift: return 0x; - * case sf::Keyboard::RAlt: return 0x; - * case sf::Keyboard::RSystem: return 0x; + * case sf::Keyboard::LControl: return 0x; + * case sf::Keyboard::LShift: return 0x; + * case sf::Keyboard::LAlt: return 0x; + * case sf::Keyboard::LSystem: return 0x; + * case sf::Keyboard::RControl: return 0x; + * case sf::Keyboard::RShift: return 0x; + * case sf::Keyboard::RAlt: return 0x; + * case sf::Keyboard::RSystem: return 0x; */ case sf::Keyboard::Menu: return NSMenuFunctionKey; - case sf::Keyboard::LBracket: return 0x5b; - case sf::Keyboard::RBracket: return 0x5d; - case sf::Keyboard::SemiColon: return 0x3b; - case sf::Keyboard::Comma: return 0x2c; - case sf::Keyboard::Period: return 0x2e; - case sf::Keyboard::Quote: return 0x27; - case sf::Keyboard::Slash: return 0x2044; // 0x2f is Divide - case sf::Keyboard::BackSlash: return 0x5c; - case sf::Keyboard::Tilde: return 0x7e; - case sf::Keyboard::Equal: return 0x3d; - case sf::Keyboard::Dash: return 0x2013; // 0x2d is Subtract - case sf::Keyboard::Space: return 0x20; - case sf::Keyboard::Return: return 0x0d; - case sf::Keyboard::BackSpace: return 0x7f; // NOTE backspace & delete are swapped on Mac. - case sf::Keyboard::Tab: return 0x09; + case sf::Keyboard::LBracket: return 0x5b; + case sf::Keyboard::RBracket: return 0x5d; + case sf::Keyboard::SemiColon: return 0x3b; + case sf::Keyboard::Comma: return 0x2c; + case sf::Keyboard::Period: return 0x2e; + case sf::Keyboard::Quote: return 0x27; + case sf::Keyboard::Slash: return 0x2044; // 0x2f is Divide + case sf::Keyboard::BackSlash: return 0x5c; + case sf::Keyboard::Tilde: return 0x7e; + case sf::Keyboard::Equal: return 0x3d; + case sf::Keyboard::Dash: return 0x2013; // 0x2d is Subtract + case sf::Keyboard::Space: return 0x20; + case sf::Keyboard::Return: return 0x0d; + case sf::Keyboard::BackSpace: return 0x7f; // NOTE backspace & delete are swapped on Mac. + case sf::Keyboard::Tab: return 0x09; - case sf::Keyboard::PageUp: return NSPageUpFunctionKey; - case sf::Keyboard::PageDown: return NSPageDownFunctionKey; - case sf::Keyboard::End: return NSEndFunctionKey; - case sf::Keyboard::Home: return NSHomeFunctionKey; - case sf::Keyboard::Insert: return NSInsertFunctionKey; - case sf::Keyboard::Delete: return NSDeleteFunctionKey; + case sf::Keyboard::PageUp: return NSPageUpFunctionKey; + case sf::Keyboard::PageDown: return NSPageDownFunctionKey; + case sf::Keyboard::End: return NSEndFunctionKey; + case sf::Keyboard::Home: return NSHomeFunctionKey; + case sf::Keyboard::Insert: return NSInsertFunctionKey; + case sf::Keyboard::Delete: return NSDeleteFunctionKey; - case sf::Keyboard::Add: return 0x2b; - case sf::Keyboard::Subtract: return 0x2d; - case sf::Keyboard::Multiply: return 0x2a; - case sf::Keyboard::Divide: return 0x2f; + case sf::Keyboard::Add: return 0x2b; + case sf::Keyboard::Subtract: return 0x2d; + case sf::Keyboard::Multiply: return 0x2a; + case sf::Keyboard::Divide: return 0x2f; - case sf::Keyboard::Left: return NSLeftArrowFunctionKey; - case sf::Keyboard::Right: return NSRightArrowFunctionKey; - case sf::Keyboard::Up: return NSUpArrowFunctionKey; - case sf::Keyboard::Down: return NSDownArrowFunctionKey; + case sf::Keyboard::Left: return NSLeftArrowFunctionKey; + case sf::Keyboard::Right: return NSRightArrowFunctionKey; + case sf::Keyboard::Up: return NSUpArrowFunctionKey; + case sf::Keyboard::Down: return NSDownArrowFunctionKey; /* Those are not represented using Unicode. - * case sf::Keyboard::Numpad0: return 0x; - * case sf::Keyboard::Numpad1: return 0x; - * case sf::Keyboard::Numpad2: return 0x; - * case sf::Keyboard::Numpad3: return 0x; - * case sf::Keyboard::Numpad4: return 0x; - * case sf::Keyboard::Numpad5: return 0x; - * case sf::Keyboard::Numpad6: return 0x; - * case sf::Keyboard::Numpad7: return 0x; - * case sf::Keyboard::Numpad8: return 0x; - * case sf::Keyboard::Numpad9: return 0x; + * case sf::Keyboard::Numpad0: return 0x; + * case sf::Keyboard::Numpad1: return 0x; + * case sf::Keyboard::Numpad2: return 0x; + * case sf::Keyboard::Numpad3: return 0x; + * case sf::Keyboard::Numpad4: return 0x; + * case sf::Keyboard::Numpad5: return 0x; + * case sf::Keyboard::Numpad6: return 0x; + * case sf::Keyboard::Numpad7: return 0x; + * case sf::Keyboard::Numpad8: return 0x; + * case sf::Keyboard::Numpad9: return 0x; */ - case sf::Keyboard::F1: return NSF1FunctionKey; - case sf::Keyboard::F2: return NSF2FunctionKey; - case sf::Keyboard::F3: return NSF3FunctionKey; - case sf::Keyboard::F4: return NSF4FunctionKey; - case sf::Keyboard::F5: return NSF5FunctionKey; - case sf::Keyboard::F6: return NSF6FunctionKey; - case sf::Keyboard::F7: return NSF7FunctionKey; - case sf::Keyboard::F8: return NSF8FunctionKey; - case sf::Keyboard::F9: return NSF9FunctionKey; - case sf::Keyboard::F10: return NSF10FunctionKey; - case sf::Keyboard::F11: return NSF11FunctionKey; - case sf::Keyboard::F12: return NSF12FunctionKey; - case sf::Keyboard::F13: return NSF13FunctionKey; - case sf::Keyboard::F14: return NSF14FunctionKey; - case sf::Keyboard::F15: return NSF15FunctionKey; + case sf::Keyboard::F1: return NSF1FunctionKey; + case sf::Keyboard::F2: return NSF2FunctionKey; + case sf::Keyboard::F3: return NSF3FunctionKey; + case sf::Keyboard::F4: return NSF4FunctionKey; + case sf::Keyboard::F5: return NSF5FunctionKey; + case sf::Keyboard::F6: return NSF6FunctionKey; + case sf::Keyboard::F7: return NSF7FunctionKey; + case sf::Keyboard::F8: return NSF8FunctionKey; + case sf::Keyboard::F9: return NSF9FunctionKey; + case sf::Keyboard::F10: return NSF10FunctionKey; + case sf::Keyboard::F11: return NSF11FunctionKey; + case sf::Keyboard::F12: return NSF12FunctionKey; + case sf::Keyboard::F13: return NSF13FunctionKey; + case sf::Keyboard::F14: return NSF14FunctionKey; + case sf::Keyboard::F15: return NSF15FunctionKey; - case sf::Keyboard::Pause: return NSPauseFunctionKey; + case sf::Keyboard::Pause: return NSPauseFunctionKey; - default: return 0x00; + default: return 0x00; } } @@ -957,151 +957,151 @@ Keyboard::Scancode HIDInputManager::nonLocalizedKey(UniChar virtualKeycode) // /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/Headers/Events.h switch (virtualKeycode) { - case 0x00: return sf::Keyboard::sA; - case 0x0b: return sf::Keyboard::sB; - case 0x08: return sf::Keyboard::sC; - case 0x02: return sf::Keyboard::sD; - case 0x0e: return sf::Keyboard::sE; - case 0x03: return sf::Keyboard::sF; - case 0x05: return sf::Keyboard::sG; - case 0x04: return sf::Keyboard::sH; - case 0x22: return sf::Keyboard::sI; - case 0x26: return sf::Keyboard::sJ; - case 0x28: return sf::Keyboard::sK; - case 0x25: return sf::Keyboard::sL; - case 0x2e: return sf::Keyboard::sM; - case 0x2d: return sf::Keyboard::sN; - case 0x1f: return sf::Keyboard::sO; - case 0x23: return sf::Keyboard::sP; - case 0x0c: return sf::Keyboard::sQ; - case 0x0f: return sf::Keyboard::sR; - case 0x01: return sf::Keyboard::sS; - case 0x11: return sf::Keyboard::sT; - case 0x20: return sf::Keyboard::sU; - case 0x09: return sf::Keyboard::sV; - case 0x0d: return sf::Keyboard::sW; - case 0x07: return sf::Keyboard::sX; - case 0x10: return sf::Keyboard::sY; - case 0x06: return sf::Keyboard::sZ; + case 0x00: return sf::Keyboard::ScanA; + case 0x0b: return sf::Keyboard::ScanB; + case 0x08: return sf::Keyboard::ScanC; + case 0x02: return sf::Keyboard::ScanD; + case 0x0e: return sf::Keyboard::ScanE; + case 0x03: return sf::Keyboard::ScanF; + case 0x05: return sf::Keyboard::ScanG; + case 0x04: return sf::Keyboard::ScanH; + case 0x22: return sf::Keyboard::ScanI; + case 0x26: return sf::Keyboard::ScanJ; + case 0x28: return sf::Keyboard::ScanK; + case 0x25: return sf::Keyboard::ScanL; + case 0x2e: return sf::Keyboard::ScanM; + case 0x2d: return sf::Keyboard::ScanN; + case 0x1f: return sf::Keyboard::ScanO; + case 0x23: return sf::Keyboard::ScanP; + case 0x0c: return sf::Keyboard::ScanQ; + case 0x0f: return sf::Keyboard::ScanR; + case 0x01: return sf::Keyboard::ScanS; + case 0x11: return sf::Keyboard::ScanT; + case 0x20: return sf::Keyboard::ScanU; + case 0x09: return sf::Keyboard::ScanV; + case 0x0d: return sf::Keyboard::ScanW; + case 0x07: return sf::Keyboard::ScanX; + case 0x10: return sf::Keyboard::ScanY; + case 0x06: return sf::Keyboard::ScanZ; - case 0x12: return sf::Keyboard::sNum1; - case 0x13: return sf::Keyboard::sNum2; - case 0x14: return sf::Keyboard::sNum3; - case 0x15: return sf::Keyboard::sNum4; - case 0x17: return sf::Keyboard::sNum5; - case 0x16: return sf::Keyboard::sNum6; - case 0x1a: return sf::Keyboard::sNum7; - case 0x1c: return sf::Keyboard::sNum8; - case 0x19: return sf::Keyboard::sNum9; - case 0x1d: return sf::Keyboard::sNum0; + case 0x12: return sf::Keyboard::ScanNum1; + case 0x13: return sf::Keyboard::ScanNum2; + case 0x14: return sf::Keyboard::ScanNum3; + case 0x15: return sf::Keyboard::ScanNum4; + case 0x17: return sf::Keyboard::ScanNum5; + case 0x16: return sf::Keyboard::ScanNum6; + case 0x1a: return sf::Keyboard::ScanNum7; + case 0x1c: return sf::Keyboard::ScanNum8; + case 0x19: return sf::Keyboard::ScanNum9; + case 0x1d: return sf::Keyboard::ScanNum0; - case 0x24: return sf::Keyboard::sEnter; - case 0x35: return sf::Keyboard::sEscape; - case 0x33: return sf::Keyboard::sBackspace; - case 0x30: return sf::Keyboard::sTab; - case 0x31: return sf::Keyboard::sSpace; - // case 0x27: return sf::Keyboard::sHyphen; // TODO 0x27 is for Quote - case 0x18: return sf::Keyboard::sEquals; - case 0x21: return sf::Keyboard::sLBracket; - case 0x1e: return sf::Keyboard::sRBracket; - case 0x2a: return sf::Keyboard::sBackslash; - case 0x1b: return sf::Keyboard::sDash; - case 0x29: return sf::Keyboard::sSemicolon; - case 0x27: return sf::Keyboard::sQuote; - case 0x32: return sf::Keyboard::sGraveAccent; - case 0x2b: return sf::Keyboard::sComma; - case 0x2f: return sf::Keyboard::sPeriod; - case 0x2c: return sf::Keyboard::sForwardSlash; + case 0x24: return sf::Keyboard::ScanEnter; + case 0x35: return sf::Keyboard::ScanEscape; + case 0x33: return sf::Keyboard::ScanBackspace; + case 0x30: return sf::Keyboard::ScanTab; + case 0x31: return sf::Keyboard::ScanSpace; + // case 0x27: return sf::Keyboard::ScanHyphen; // TODO 0x27 is for Quote + case 0x18: return sf::Keyboard::ScanEquals; + case 0x21: return sf::Keyboard::ScanLBracket; + case 0x1e: return sf::Keyboard::ScanRBracket; + case 0x2a: return sf::Keyboard::ScanBackslash; + case 0x1b: return sf::Keyboard::ScanDash; + case 0x29: return sf::Keyboard::ScanSemicolon; + case 0x27: return sf::Keyboard::ScanQuote; + case 0x32: return sf::Keyboard::ScanGraveAccent; + case 0x2b: return sf::Keyboard::ScanComma; + case 0x2f: return sf::Keyboard::ScanPeriod; + case 0x2c: return sf::Keyboard::ScanSlash; - case 0x7a: return sf::Keyboard::sF1; - case 0x78: return sf::Keyboard::sF2; - case 0x63: return sf::Keyboard::sF3; - case 0x76: return sf::Keyboard::sF4; - case 0x60: return sf::Keyboard::sF5; - case 0x61: return sf::Keyboard::sF6; - case 0x62: return sf::Keyboard::sF7; - case 0x64: return sf::Keyboard::sF8; - case 0x65: return sf::Keyboard::sF9; - case 0x6d: return sf::Keyboard::sF10; - case 0x67: return sf::Keyboard::sF11; - case 0x6f: return sf::Keyboard::sF12; - case 0x69: return sf::Keyboard::sF13; - case 0x6b: return sf::Keyboard::sF14; - case 0x71: return sf::Keyboard::sF15; + case 0x7a: return sf::Keyboard::ScanF1; + case 0x78: return sf::Keyboard::ScanF2; + case 0x63: return sf::Keyboard::ScanF3; + case 0x76: return sf::Keyboard::ScanF4; + case 0x60: return sf::Keyboard::ScanF5; + case 0x61: return sf::Keyboard::ScanF6; + case 0x62: return sf::Keyboard::ScanF7; + case 0x64: return sf::Keyboard::ScanF8; + case 0x65: return sf::Keyboard::ScanF9; + case 0x6d: return sf::Keyboard::ScanF10; + case 0x67: return sf::Keyboard::ScanF11; + case 0x6f: return sf::Keyboard::ScanF12; + case 0x69: return sf::Keyboard::ScanF13; + case 0x6b: return sf::Keyboard::ScanF14; + case 0x71: return sf::Keyboard::ScanF15; - case 0x39: return sf::Keyboard::sCapsLock; + case 0x39: return sf::Keyboard::ScanCapsLock; /* TODO Those are missing: - * case 0x: return sf::Keyboard::sPrintScreen; - * case 0x: return sf::Keyboard::sScrollLock; - * case 0x: return sf::Keyboard::sPause; + * case 0x: return sf::Keyboard::ScanPrintScreen; + * case 0x: return sf::Keyboard::ScanScrollLock; + * case 0x: return sf::Keyboard::ScanPause; */ - case 0x72: return sf::Keyboard::sInsert; - case 0x73: return sf::Keyboard::sHome; - case 0x74: return sf::Keyboard::sPageUp; - case 0x75: return sf::Keyboard::sDelete; - case 0x77: return sf::Keyboard::sEnd; - case 0x79: return sf::Keyboard::sPageDown; + case 0x72: return sf::Keyboard::ScanInsert; + case 0x73: return sf::Keyboard::ScanHome; + case 0x74: return sf::Keyboard::ScanPageUp; + case 0x75: return sf::Keyboard::ScanDelete; + case 0x77: return sf::Keyboard::ScanEnd; + case 0x79: return sf::Keyboard::ScanPageDown; - case 0x7c: return sf::Keyboard::sRight; - case 0x7b: return sf::Keyboard::sLeft; - case 0x7d: return sf::Keyboard::sDown; - case 0x7e: return sf::Keyboard::sUp; + case 0x7c: return sf::Keyboard::ScanRight; + case 0x7b: return sf::Keyboard::ScanLeft; + case 0x7d: return sf::Keyboard::ScanDown; + case 0x7e: return sf::Keyboard::ScanUp; - case 0x47: return sf::Keyboard::sNumLock; - case 0x4b: return sf::Keyboard::sDivide; - case 0x43: return sf::Keyboard::sMultiply; - case 0x4e: return sf::Keyboard::sMinus; - case 0x45: return sf::Keyboard::sPlus; - case 0x51: return sf::Keyboard::sPadEquals; - case 0x4c: return sf::Keyboard::sReturn; - case 0x41: return sf::Keyboard::sDecimal; + case 0x47: return sf::Keyboard::ScanNumLock; + case 0x4b: return sf::Keyboard::ScanDivide; + case 0x43: return sf::Keyboard::ScanMultiply; + case 0x4e: return sf::Keyboard::ScanMinus; + case 0x45: return sf::Keyboard::ScanPlus; + case 0x51: return sf::Keyboard::ScanNumpadEquals; + case 0x4c: return sf::Keyboard::ScanNumpadEnter; + case 0x41: return sf::Keyboard::ScanDecimal; - case 0x53: return sf::Keyboard::sNumpad1; - case 0x54: return sf::Keyboard::sNumpad2; - case 0x55: return sf::Keyboard::sNumpad3; - case 0x56: return sf::Keyboard::sNumpad4; - case 0x57: return sf::Keyboard::sNumpad5; - case 0x58: return sf::Keyboard::sNumpad6; - case 0x59: return sf::Keyboard::sNumpad7; - case 0x5b: return sf::Keyboard::sNumpad8; - case 0x5c: return sf::Keyboard::sNumpad9; - case 0x52: return sf::Keyboard::sNumpad0; + case 0x53: return sf::Keyboard::ScanNumpad1; + case 0x54: return sf::Keyboard::ScanNumpad2; + case 0x55: return sf::Keyboard::ScanNumpad3; + case 0x56: return sf::Keyboard::ScanNumpad4; + case 0x57: return sf::Keyboard::ScanNumpad5; + case 0x58: return sf::Keyboard::ScanNumpad6; + case 0x59: return sf::Keyboard::ScanNumpad7; + case 0x5b: return sf::Keyboard::ScanNumpad8; + case 0x5c: return sf::Keyboard::ScanNumpad9; + case 0x52: return sf::Keyboard::ScanNumpad0; /* TODO Those are missing: - * case 0x: return sf::Keyboard::sReverseSolidus; - * case 0x: return sf::Keyboard::sApplication; - * case 0x: return sf::Keyboard::sExecute; - * case 0x72: return sf::Keyboard::sHelp; // 0x72 is for Insert - * case 0x: return sf::Keyboard::sMenu; - * case 0x: return sf::Keyboard::sSelect; - * case 0x: return sf::Keyboard::sStop; - * case 0x: return sf::Keyboard::sAgain; - * case 0x: return sf::Keyboard::sUndo; - * case 0x: return sf::Keyboard::sCut; - * case 0x: return sf::Keyboard::sCopy; - * case 0x: return sf::Keyboard::sPaste; - * case 0x: return sf::Keyboard::sFind; + * case 0x: return sf::Keyboard::ScanReverseSolidus; + * case 0x: return sf::Keyboard::ScanApplication; + * case 0x: return sf::Keyboard::ScanExecute; + * case 0x72: return sf::Keyboard::ScanHelp; // 0x72 is for Insert + * case 0x: return sf::Keyboard::ScanMenu; + * case 0x: return sf::Keyboard::ScanSelect; + * case 0x: return sf::Keyboard::ScanStop; + * case 0x: return sf::Keyboard::ScanAgain; + * case 0x: return sf::Keyboard::ScanUndo; + * case 0x: return sf::Keyboard::ScanCut; + * case 0x: return sf::Keyboard::ScanCopy; + * case 0x: return sf::Keyboard::ScanPaste; + * case 0x: return sf::Keyboard::ScanFind; */ - case 0x4a: return sf::Keyboard::sMute; - case 0x48: return sf::Keyboard::sVolumeUp; - case 0x49: return sf::Keyboard::sVolumeDown; + case 0x4a: return sf::Keyboard::ScanMute; + case 0x48: return sf::Keyboard::ScanVolumeUp; + case 0x49: return sf::Keyboard::ScanVolumeDown; /* NOTE Those are symmetric so we leave them out. * Thankfully handled through modifiers and not virtual codes. - * case 0x3b: return sf::Keyboard::sLControl; - * case 0x38: return sf::Keyboard::sLShift; - * case 0x3a: return sf::Keyboard::sLAlt; - * case 0x37: return sf::Keyboard::sLSystem; - * case 0x3b: return sf::Keyboard::sRControl; - * case 0x38: return sf::Keyboard::sRShift; - * case 0x3a: return sf::Keyboard::sRAlt; - * case 0x37: return sf::Keyboard::sRSystem; + * case 0x3b: return sf::Keyboard::ScanLControl; + * case 0x38: return sf::Keyboard::ScanLShift; + * case 0x3a: return sf::Keyboard::ScanLAlt; + * case 0x37: return sf::Keyboard::ScanLSystem; + * case 0x3b: return sf::Keyboard::ScanRControl; + * case 0x38: return sf::Keyboard::ScanRShift; + * case 0x3a: return sf::Keyboard::ScanRAlt; + * case 0x37: return sf::Keyboard::ScanRSystem; */ - default: return sf::Keyboard::sUnknown; + default: return sf::Keyboard::ScanUnknown; } } @@ -1111,147 +1111,147 @@ UInt8 HIDInputManager::scanToVirtualCode(Keyboard::Scancode code) { switch (code) { - case sf::Keyboard::sA: return 0x00; - case sf::Keyboard::sB: return 0x0b; - case sf::Keyboard::sC: return 0x08; - case sf::Keyboard::sD: return 0x02; - case sf::Keyboard::sE: return 0x0e; - case sf::Keyboard::sF: return 0x03; - case sf::Keyboard::sG: return 0x05; - case sf::Keyboard::sH: return 0x04; - case sf::Keyboard::sI: return 0x22; - case sf::Keyboard::sJ: return 0x26; - case sf::Keyboard::sK: return 0x28; - case sf::Keyboard::sL: return 0x25; - case sf::Keyboard::sM: return 0x2e; - case sf::Keyboard::sN: return 0x2d; - case sf::Keyboard::sO: return 0x1f; - case sf::Keyboard::sP: return 0x23; - case sf::Keyboard::sQ: return 0x0c; - case sf::Keyboard::sR: return 0x0f; - case sf::Keyboard::sS: return 0x01; - case sf::Keyboard::sT: return 0x11; - case sf::Keyboard::sU: return 0x20; - case sf::Keyboard::sV: return 0x09; - case sf::Keyboard::sW: return 0x0d; - case sf::Keyboard::sX: return 0x07; - case sf::Keyboard::sY: return 0x10; - case sf::Keyboard::sZ: return 0x06; + case sf::Keyboard::ScanA: return 0x00; + case sf::Keyboard::ScanB: return 0x0b; + case sf::Keyboard::ScanC: return 0x08; + case sf::Keyboard::ScanD: return 0x02; + case sf::Keyboard::ScanE: return 0x0e; + case sf::Keyboard::ScanF: return 0x03; + case sf::Keyboard::ScanG: return 0x05; + case sf::Keyboard::ScanH: return 0x04; + case sf::Keyboard::ScanI: return 0x22; + case sf::Keyboard::ScanJ: return 0x26; + case sf::Keyboard::ScanK: return 0x28; + case sf::Keyboard::ScanL: return 0x25; + case sf::Keyboard::ScanM: return 0x2e; + case sf::Keyboard::ScanN: return 0x2d; + case sf::Keyboard::ScanO: return 0x1f; + case sf::Keyboard::ScanP: return 0x23; + case sf::Keyboard::ScanQ: return 0x0c; + case sf::Keyboard::ScanR: return 0x0f; + case sf::Keyboard::ScanS: return 0x01; + case sf::Keyboard::ScanT: return 0x11; + case sf::Keyboard::ScanU: return 0x20; + case sf::Keyboard::ScanV: return 0x09; + case sf::Keyboard::ScanW: return 0x0d; + case sf::Keyboard::ScanX: return 0x07; + case sf::Keyboard::ScanY: return 0x10; + case sf::Keyboard::ScanZ: return 0x06; - case sf::Keyboard::sNum1: return 0x12; - case sf::Keyboard::sNum2: return 0x13; - case sf::Keyboard::sNum3: return 0x14; - case sf::Keyboard::sNum4: return 0x15; - case sf::Keyboard::sNum5: return 0x17; - case sf::Keyboard::sNum6: return 0x16; - case sf::Keyboard::sNum7: return 0x1a; - case sf::Keyboard::sNum8: return 0x1c; - case sf::Keyboard::sNum9: return 0x19; - case sf::Keyboard::sNum0: return 0x1d; + case sf::Keyboard::ScanNum1: return 0x12; + case sf::Keyboard::ScanNum2: return 0x13; + case sf::Keyboard::ScanNum3: return 0x14; + case sf::Keyboard::ScanNum4: return 0x15; + case sf::Keyboard::ScanNum5: return 0x17; + case sf::Keyboard::ScanNum6: return 0x16; + case sf::Keyboard::ScanNum7: return 0x1a; + case sf::Keyboard::ScanNum8: return 0x1c; + case sf::Keyboard::ScanNum9: return 0x19; + case sf::Keyboard::ScanNum0: return 0x1d; - case sf::Keyboard::sEnter: return 0x24; - case sf::Keyboard::sEscape: return 0x35; - case sf::Keyboard::sBackspace: return 0x33; - case sf::Keyboard::sTab: return 0x30; - case sf::Keyboard::sSpace: return 0x31; + case sf::Keyboard::ScanEnter: return 0x24; + case sf::Keyboard::ScanEscape: return 0x35; + case sf::Keyboard::ScanBackspace: return 0x33; + case sf::Keyboard::ScanTab: return 0x30; + case sf::Keyboard::ScanSpace: return 0x31; - // case sf::Keyboard::sHyphen: return 0; // 0x27 is for Quote + // case sf::Keyboard::ScanHyphen: return 0; // 0x27 is for Quote - case sf::Keyboard::sEquals: return 0x18; - case sf::Keyboard::sLBracket: return 0x21; - case sf::Keyboard::sRBracket: return 0x1e; - case sf::Keyboard::sBackslash: return 0x2a; - case sf::Keyboard::sDash: return 0x1b; - case sf::Keyboard::sSemicolon: return 0x29; - case sf::Keyboard::sQuote: return 0x27; - case sf::Keyboard::sGraveAccent: return 0x32; - case sf::Keyboard::sComma: return 0x2b; - case sf::Keyboard::sPeriod: return 0x2f; - case sf::Keyboard::sForwardSlash: return 0x2c; + case sf::Keyboard::ScanEquals: return 0x18; + case sf::Keyboard::ScanLBracket: return 0x21; + case sf::Keyboard::ScanRBracket: return 0x1e; + case sf::Keyboard::ScanBackslash: return 0x2a; + case sf::Keyboard::ScanDash: return 0x1b; + case sf::Keyboard::ScanSemicolon: return 0x29; + case sf::Keyboard::ScanQuote: return 0x27; + case sf::Keyboard::ScanGraveAccent: return 0x32; + case sf::Keyboard::ScanComma: return 0x2b; + case sf::Keyboard::ScanPeriod: return 0x2f; + case sf::Keyboard::ScanSlash: return 0x2c; - case sf::Keyboard::sF1: return 0x7a; - case sf::Keyboard::sF2: return 0x78; - case sf::Keyboard::sF3: return 0x63; - case sf::Keyboard::sF4: return 0x76; - case sf::Keyboard::sF5: return 0x60; - case sf::Keyboard::sF6: return 0x61; - case sf::Keyboard::sF7: return 0x62; - case sf::Keyboard::sF8: return 0x64; - case sf::Keyboard::sF9: return 0x65; - case sf::Keyboard::sF10: return 0x6d; - case sf::Keyboard::sF11: return 0x67; - case sf::Keyboard::sF12: return 0x6f; - case sf::Keyboard::sF13: return 0x69; - case sf::Keyboard::sF14: return 0x6b; - case sf::Keyboard::sF15: return 0x71; + case sf::Keyboard::ScanF1: return 0x7a; + case sf::Keyboard::ScanF2: return 0x78; + case sf::Keyboard::ScanF3: return 0x63; + case sf::Keyboard::ScanF4: return 0x76; + case sf::Keyboard::ScanF5: return 0x60; + case sf::Keyboard::ScanF6: return 0x61; + case sf::Keyboard::ScanF7: return 0x62; + case sf::Keyboard::ScanF8: return 0x64; + case sf::Keyboard::ScanF9: return 0x65; + case sf::Keyboard::ScanF10: return 0x6d; + case sf::Keyboard::ScanF11: return 0x67; + case sf::Keyboard::ScanF12: return 0x6f; + case sf::Keyboard::ScanF13: return 0x69; + case sf::Keyboard::ScanF14: return 0x6b; + case sf::Keyboard::ScanF15: return 0x71; - case sf::Keyboard::sCapsLock: return 0x39; + case sf::Keyboard::ScanCapsLock: return 0x39; /* TODO Those are missing: - * case sf::Keyboard::sPrintScreen: return 0; - * case sf::Keyboard::sScrollLock: return 0; - * case sf::Keyboard::sPause: return 0; + * case sf::Keyboard::ScanPrintScreen: return 0; + * case sf::Keyboard::ScanScrollLock: return 0; + * case sf::Keyboard::ScanPause: return 0; */ - case sf::Keyboard::sInsert: return 0x72; - case sf::Keyboard::sHome: return 0x73; - case sf::Keyboard::sPageUp: return 0x74; - case sf::Keyboard::sDelete: return 0x75; - case sf::Keyboard::sEnd: return 0x77; - case sf::Keyboard::sPageDown: return 0x79; + case sf::Keyboard::ScanInsert: return 0x72; + case sf::Keyboard::ScanHome: return 0x73; + case sf::Keyboard::ScanPageUp: return 0x74; + case sf::Keyboard::ScanDelete: return 0x75; + case sf::Keyboard::ScanEnd: return 0x77; + case sf::Keyboard::ScanPageDown: return 0x79; - case sf::Keyboard::sRight: return 0x7c; - case sf::Keyboard::sLeft: return 0x7b; - case sf::Keyboard::sDown: return 0x7d; - case sf::Keyboard::sUp: return 0x7e; + case sf::Keyboard::ScanRight: return 0x7c; + case sf::Keyboard::ScanLeft: return 0x7b; + case sf::Keyboard::ScanDown: return 0x7d; + case sf::Keyboard::ScanUp: return 0x7e; - case sf::Keyboard::sNumLock: return 0x47; - case sf::Keyboard::sDivide: return 0x4b; - case sf::Keyboard::sMultiply: return 0x43; - case sf::Keyboard::sMinus: return 0x4e; - case sf::Keyboard::sPlus: return 0x45; - case sf::Keyboard::sPadEquals: return 0x51; - case sf::Keyboard::sReturn: return 0x4c; - case sf::Keyboard::sDecimal: return 0x41; + case sf::Keyboard::ScanNumLock: return 0x47; + case sf::Keyboard::ScanDivide: return 0x4b; + case sf::Keyboard::ScanMultiply: return 0x43; + case sf::Keyboard::ScanMinus: return 0x4e; + case sf::Keyboard::ScanPlus: return 0x45; + case sf::Keyboard::ScanNumpadEquals: return 0x51; + case sf::Keyboard::ScanNumpadEnter: return 0x4c; + case sf::Keyboard::ScanDecimal: return 0x41; - case sf::Keyboard::sNumpad1: return 0x53; - case sf::Keyboard::sNumpad2: return 0x54; - case sf::Keyboard::sNumpad3: return 0x55; - case sf::Keyboard::sNumpad4: return 0x56; - case sf::Keyboard::sNumpad5: return 0x57; - case sf::Keyboard::sNumpad6: return 0x58; - case sf::Keyboard::sNumpad7: return 0x59; - case sf::Keyboard::sNumpad8: return 0x5b; - case sf::Keyboard::sNumpad9: return 0x5c; - case sf::Keyboard::sNumpad0: return 0x52; + case sf::Keyboard::ScanNumpad1: return 0x53; + case sf::Keyboard::ScanNumpad2: return 0x54; + case sf::Keyboard::ScanNumpad3: return 0x55; + case sf::Keyboard::ScanNumpad4: return 0x56; + case sf::Keyboard::ScanNumpad5: return 0x57; + case sf::Keyboard::ScanNumpad6: return 0x58; + case sf::Keyboard::ScanNumpad7: return 0x59; + case sf::Keyboard::ScanNumpad8: return 0x5b; + case sf::Keyboard::ScanNumpad9: return 0x5c; + case sf::Keyboard::ScanNumpad0: return 0x52; /* TODO Those are missing: - * case sf::Keyboard::sReverseSolidus: return 0; - * case sf::Keyboard::sApplication: return 0; - * case sf::Keyboard::sExecute: return 0; - * case sf::Keyboard::sHelp: return 0; - * case sf::Keyboard::sMenu: return 0; - * case sf::Keyboard::sSelect: return 0; - * case sf::Keyboard::sStop: return 0; - * case sf::Keyboard::sAgain: return 0; - * case sf::Keyboard::sUndo: return 0; - * case sf::Keyboard::sCut: return 0; - * case sf::Keyboard::sCopy: return 0; - * case sf::Keyboard::sPaste: return 0; - * case sf::Keyboard::sFind: return 0; + * case sf::Keyboard::ScanReverseSolidus: return 0; + * case sf::Keyboard::ScanApplication: return 0; + * case sf::Keyboard::ScanExecute: return 0; + * case sf::Keyboard::ScanHelp: return 0; + * case sf::Keyboard::ScanMenu: return 0; + * case sf::Keyboard::ScanSelect: return 0; + * case sf::Keyboard::ScanStop: return 0; + * case sf::Keyboard::ScanAgain: return 0; + * case sf::Keyboard::ScanUndo: return 0; + * case sf::Keyboard::ScanCut: return 0; + * case sf::Keyboard::ScanCopy: return 0; + * case sf::Keyboard::ScanPaste: return 0; + * case sf::Keyboard::ScanFind: return 0; */ - case sf::Keyboard::sMute: return 0x4a; - case sf::Keyboard::sVolumeUp: return 0x48; - case sf::Keyboard::sVolumeDown: return 0x49; + case sf::Keyboard::ScanMute: return 0x4a; + case sf::Keyboard::ScanVolumeUp: return 0x48; + case sf::Keyboard::ScanVolumeDown: return 0x49; - case sf::Keyboard::sLControl: return 0x3b; - case sf::Keyboard::sLShift: return 0x38; - case sf::Keyboard::sLAlt: return 0x3a; - case sf::Keyboard::sLSystem: return 0x37; - case sf::Keyboard::sRControl: return 0x3b; - case sf::Keyboard::sRShift: return 0x38; - case sf::Keyboard::sRAlt: return 0x3a; - case sf::Keyboard::sRSystem: return 0x37; + case sf::Keyboard::ScanLControl: return 0x3b; + case sf::Keyboard::ScanLShift: return 0x38; + case sf::Keyboard::ScanLAlt: return 0x3a; + case sf::Keyboard::ScanLSystem: return 0x37; + case sf::Keyboard::ScanRControl: return 0x3b; + case sf::Keyboard::ScanRShift: return 0x38; + case sf::Keyboard::ScanRAlt: return 0x3a; + case sf::Keyboard::ScanRSystem: return 0x37; default: return 0x00; } @@ -1263,65 +1263,65 @@ Keyboard::Key HIDInputManager::localizedKeyFallback(Keyboard::Scancode code) { switch (code) { - case sf::Keyboard::sEnter: return sf::Keyboard::Return; - case sf::Keyboard::sEscape: return sf::Keyboard::Escape; - case sf::Keyboard::sBackspace: return sf::Keyboard::BackSpace; - case sf::Keyboard::sTab: return sf::Keyboard::Tab; - case sf::Keyboard::sSpace: return sf::Keyboard::Space; + case sf::Keyboard::ScanEnter: return sf::Keyboard::Return; + case sf::Keyboard::ScanEscape: return sf::Keyboard::Escape; + case sf::Keyboard::ScanBackspace: return sf::Keyboard::BackSpace; + case sf::Keyboard::ScanTab: return sf::Keyboard::Tab; + case sf::Keyboard::ScanSpace: return sf::Keyboard::Space; - case sf::Keyboard::sF1: return sf::Keyboard::F1; - case sf::Keyboard::sF2: return sf::Keyboard::F2; - case sf::Keyboard::sF3: return sf::Keyboard::F3; - case sf::Keyboard::sF4: return sf::Keyboard::F4; - case sf::Keyboard::sF5: return sf::Keyboard::F5; - case sf::Keyboard::sF6: return sf::Keyboard::F6; - case sf::Keyboard::sF7: return sf::Keyboard::F7; - case sf::Keyboard::sF8: return sf::Keyboard::F8; - case sf::Keyboard::sF9: return sf::Keyboard::F9; - case sf::Keyboard::sF10: return sf::Keyboard::F10; - case sf::Keyboard::sF11: return sf::Keyboard::F11; - case sf::Keyboard::sF12: return sf::Keyboard::F12; - case sf::Keyboard::sF13: return sf::Keyboard::F13; - case sf::Keyboard::sF14: return sf::Keyboard::F14; - case sf::Keyboard::sF15: return sf::Keyboard::F15; + case sf::Keyboard::ScanF1: return sf::Keyboard::F1; + case sf::Keyboard::ScanF2: return sf::Keyboard::F2; + case sf::Keyboard::ScanF3: return sf::Keyboard::F3; + case sf::Keyboard::ScanF4: return sf::Keyboard::F4; + case sf::Keyboard::ScanF5: return sf::Keyboard::F5; + case sf::Keyboard::ScanF6: return sf::Keyboard::F6; + case sf::Keyboard::ScanF7: return sf::Keyboard::F7; + case sf::Keyboard::ScanF8: return sf::Keyboard::F8; + case sf::Keyboard::ScanF9: return sf::Keyboard::F9; + case sf::Keyboard::ScanF10: return sf::Keyboard::F10; + case sf::Keyboard::ScanF11: return sf::Keyboard::F11; + case sf::Keyboard::ScanF12: return sf::Keyboard::F12; + case sf::Keyboard::ScanF13: return sf::Keyboard::F13; + case sf::Keyboard::ScanF14: return sf::Keyboard::F14; + case sf::Keyboard::ScanF15: return sf::Keyboard::F15; - case sf::Keyboard::sPause: return sf::Keyboard::Pause; - case sf::Keyboard::sInsert: return sf::Keyboard::Insert; - case sf::Keyboard::sHome: return sf::Keyboard::Home; - case sf::Keyboard::sPageUp: return sf::Keyboard::PageUp; - case sf::Keyboard::sDelete: return sf::Keyboard::Delete; - case sf::Keyboard::sEnd: return sf::Keyboard::End; - case sf::Keyboard::sPageDown: return sf::Keyboard::PageDown; + case sf::Keyboard::ScanPause: return sf::Keyboard::Pause; + case sf::Keyboard::ScanInsert: return sf::Keyboard::Insert; + case sf::Keyboard::ScanHome: return sf::Keyboard::Home; + case sf::Keyboard::ScanPageUp: return sf::Keyboard::PageUp; + case sf::Keyboard::ScanDelete: return sf::Keyboard::Delete; + case sf::Keyboard::ScanEnd: return sf::Keyboard::End; + case sf::Keyboard::ScanPageDown: return sf::Keyboard::PageDown; - case sf::Keyboard::sRight: return sf::Keyboard::Right; - case sf::Keyboard::sLeft: return sf::Keyboard::Left; - case sf::Keyboard::sDown: return sf::Keyboard::Down; - case sf::Keyboard::sUp: return sf::Keyboard::Up; + case sf::Keyboard::ScanRight: return sf::Keyboard::Right; + case sf::Keyboard::ScanLeft: return sf::Keyboard::Left; + case sf::Keyboard::ScanDown: return sf::Keyboard::Down; + case sf::Keyboard::ScanUp: return sf::Keyboard::Up; - case sf::Keyboard::sDivide: return sf::Keyboard::Divide; - case sf::Keyboard::sMultiply: return sf::Keyboard::Multiply; - case sf::Keyboard::sMinus: return sf::Keyboard::Subtract; - case sf::Keyboard::sPlus: return sf::Keyboard::Add; + case sf::Keyboard::ScanDivide: return sf::Keyboard::Divide; + case sf::Keyboard::ScanMultiply: return sf::Keyboard::Multiply; + case sf::Keyboard::ScanMinus: return sf::Keyboard::Subtract; + case sf::Keyboard::ScanPlus: return sf::Keyboard::Add; - case sf::Keyboard::sNumpad0: return sf::Keyboard::Numpad1; - case sf::Keyboard::sNumpad1: return sf::Keyboard::Numpad2; - case sf::Keyboard::sNumpad2: return sf::Keyboard::Numpad3; - case sf::Keyboard::sNumpad3: return sf::Keyboard::Numpad4; - case sf::Keyboard::sNumpad4: return sf::Keyboard::Numpad5; - case sf::Keyboard::sNumpad5: return sf::Keyboard::Numpad6; - case sf::Keyboard::sNumpad6: return sf::Keyboard::Numpad7; - case sf::Keyboard::sNumpad7: return sf::Keyboard::Numpad8; - case sf::Keyboard::sNumpad8: return sf::Keyboard::Numpad9; - case sf::Keyboard::sNumpad9: return sf::Keyboard::Numpad0; + case sf::Keyboard::ScanNumpad0: return sf::Keyboard::Numpad1; + case sf::Keyboard::ScanNumpad1: return sf::Keyboard::Numpad2; + case sf::Keyboard::ScanNumpad2: return sf::Keyboard::Numpad3; + case sf::Keyboard::ScanNumpad3: return sf::Keyboard::Numpad4; + case sf::Keyboard::ScanNumpad4: return sf::Keyboard::Numpad5; + case sf::Keyboard::ScanNumpad5: return sf::Keyboard::Numpad6; + case sf::Keyboard::ScanNumpad6: return sf::Keyboard::Numpad7; + case sf::Keyboard::ScanNumpad7: return sf::Keyboard::Numpad8; + case sf::Keyboard::ScanNumpad8: return sf::Keyboard::Numpad9; + case sf::Keyboard::ScanNumpad9: return sf::Keyboard::Numpad0; - case sf::Keyboard::sLControl: return sf::Keyboard::LControl; - case sf::Keyboard::sLShift: return sf::Keyboard::LShift; - case sf::Keyboard::sLAlt: return sf::Keyboard::LAlt; - case sf::Keyboard::sLSystem: return sf::Keyboard::LSystem; - case sf::Keyboard::sRControl: return sf::Keyboard::RControl; - case sf::Keyboard::sRShift: return sf::Keyboard::RShift; - case sf::Keyboard::sRAlt: return sf::Keyboard::RAlt; - case sf::Keyboard::sRSystem: return sf::Keyboard::RSystem; + case sf::Keyboard::ScanLControl: return sf::Keyboard::LControl; + case sf::Keyboard::ScanLShift: return sf::Keyboard::LShift; + case sf::Keyboard::ScanLAlt: return sf::Keyboard::LAlt; + case sf::Keyboard::ScanLSystem: return sf::Keyboard::LSystem; + case sf::Keyboard::ScanRControl: return sf::Keyboard::RControl; + case sf::Keyboard::ScanRShift: return sf::Keyboard::RShift; + case sf::Keyboard::ScanRAlt: return sf::Keyboard::RAlt; + case sf::Keyboard::ScanRSystem: return sf::Keyboard::RSystem; default: return sf::Keyboard::Unknown; } diff --git a/src/SFML/Window/OSX/InputImpl.hpp b/src/SFML/Window/OSX/InputImpl.hpp index 1965a8cf..a905747c 100644 --- a/src/SFML/Window/OSX/InputImpl.hpp +++ b/src/SFML/Window/OSX/InputImpl.hpp @@ -73,7 +73,7 @@ public: /// \copydoc sf::Keyboard::localizedRepresentation /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Keyboard::Scancode code); + static String getDescription(Keyboard::Scancode code); //////////////////////////////////////////////////////////// /// \copydoc sf::Keyboard::setVirtualKeyboardVisible diff --git a/src/SFML/Window/OSX/InputImpl.mm b/src/SFML/Window/OSX/InputImpl.mm index 201090c9..ae1a978a 100644 --- a/src/SFML/Window/OSX/InputImpl.mm +++ b/src/SFML/Window/OSX/InputImpl.mm @@ -151,7 +151,7 @@ Keyboard::Scancode InputImpl::unlocalize(Keyboard::Key key) //////////////////////////////////////////////////////////// -String InputImpl::localizedRepresentation(Keyboard::Scancode code) +String InputImpl::getDescription(Keyboard::Scancode code) { return HIDInputManager::getInstance().localizedRepresentation(code); } diff --git a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm index 1f74c511..8bf31ea8 100644 --- a/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm +++ b/src/SFML/Window/OSX/SFKeyboardModifiersHelper.mm @@ -169,7 +169,7 @@ void handleModifiersChanged(NSUInteger modifiers, sf::priv::WindowImplCocoa& req NSLeftShiftKeyMask, NSRightShiftKeyMask, state.leftShiftWasDown, state.rightShiftWasDown, sf::Keyboard::LShift, sf::Keyboard::RShift, - sf::Keyboard::sLShift, sf::Keyboard::sRShift, + sf::Keyboard::ScanLShift, sf::Keyboard::ScanRShift, requester ); @@ -179,7 +179,7 @@ void handleModifiersChanged(NSUInteger modifiers, sf::priv::WindowImplCocoa& req NSLeftCommandKeyMask, NSRightCommandKeyMask, state.leftCommandWasDown, state.rightCommandWasDown, sf::Keyboard::LSystem, sf::Keyboard::RSystem, - sf::Keyboard::sLSystem, sf::Keyboard::sRSystem, + sf::Keyboard::ScanLSystem, sf::Keyboard::ScanRSystem, requester ); @@ -189,7 +189,7 @@ void handleModifiersChanged(NSUInteger modifiers, sf::priv::WindowImplCocoa& req NSLeftAlternateKeyMask, NSRightAlternateKeyMask, state.leftAlternateWasDown, state.rightAlternateWasDown, sf::Keyboard::LAlt, sf::Keyboard::RAlt, - sf::Keyboard::sLAlt, sf::Keyboard::sRAlt, + sf::Keyboard::ScanLAlt, sf::Keyboard::ScanRAlt, requester ); @@ -199,7 +199,7 @@ void handleModifiersChanged(NSUInteger modifiers, sf::priv::WindowImplCocoa& req NSLeftControlKeyMask, NSRightControlKeyMask, state.leftControlWasDown, state.rightControlWasDown, sf::Keyboard::LControl, sf::Keyboard::RControl, - sf::Keyboard::sLControl, sf::Keyboard::sRControl, + sf::Keyboard::ScanLControl, sf::Keyboard::ScanRControl, requester ); } diff --git a/src/SFML/Window/OSX/SFOpenGLView+keyboard.mm b/src/SFML/Window/OSX/SFOpenGLView+keyboard.mm index 4c0f8883..b686d614 100644 --- a/src/SFML/Window/OSX/SFOpenGLView+keyboard.mm +++ b/src/SFML/Window/OSX/SFOpenGLView+keyboard.mm @@ -94,7 +94,7 @@ { sf::Event::KeyEvent key = [SFOpenGLView convertNSKeyEventToSFMLEvent:theEvent]; - if ((key.code != sf::Keyboard::Unknown) || (key.scancode != sf::Keyboard::sUnknown)) + if ((key.code != sf::Keyboard::Unknown) || (key.scancode != sf::Keyboard::ScanUnknown)) m_requester->keyDown(key); } diff --git a/src/SFML/Window/Unix/InputImpl.hpp b/src/SFML/Window/Unix/InputImpl.hpp index 1f135ead..1966ef1d 100644 --- a/src/SFML/Window/Unix/InputImpl.hpp +++ b/src/SFML/Window/Unix/InputImpl.hpp @@ -72,7 +72,7 @@ public: /// \copydoc sf::Keyboard::localizedRepresentation /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Keyboard::Scancode code); + static String getDescription(Keyboard::Scancode code); //////////////////////////////////////////////////////////// /// \copydoc sf::Keyboard::setVirtualKeyboardVisible diff --git a/src/SFML/Window/Win32/InputImpl.hpp b/src/SFML/Window/Win32/InputImpl.hpp index 2b14e06c..90038eac 100644 --- a/src/SFML/Window/Win32/InputImpl.hpp +++ b/src/SFML/Window/Win32/InputImpl.hpp @@ -72,7 +72,7 @@ public: /// \copydoc sf::Keyboard::localizedRepresentation /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Keyboard::Scancode code); + static String getDescription(Keyboard::Scancode code); //////////////////////////////////////////////////////////// /// \copydoc sf::Keyboard::setVirtualKeyboardVisible diff --git a/src/SFML/Window/iOS/InputImpl.hpp b/src/SFML/Window/iOS/InputImpl.hpp index a37778ab..9c02c306 100644 --- a/src/SFML/Window/iOS/InputImpl.hpp +++ b/src/SFML/Window/iOS/InputImpl.hpp @@ -72,7 +72,7 @@ public: /// \copydoc sf::Keyboard::localizedRepresentation /// //////////////////////////////////////////////////////////// - static String localizedRepresentation(Keyboard::Scancode code); + static String getDescription(Keyboard::Scancode code); //////////////////////////////////////////////////////////// /// \copydoc sf::Keyboard::setVirtualKeyboardVisible