diff --git a/include/SFML/Window/Keyboard.hpp b/include/SFML/Window/Keyboard.hpp index 9bd92575d..d008fc44b 100644 --- a/include/SFML/Window/Keyboard.hpp +++ b/include/SFML/Window/Keyboard.hpp @@ -47,7 +47,8 @@ public : //////////////////////////////////////////////////////////// enum Key { - A, ///< The A key + Unknown = -1, ///< Unhandled key + A = 0, ///< The A key B, ///< The B key C, ///< The C key D, ///< The D key diff --git a/src/SFML/Window/Linux/WindowImplX11.cpp b/src/SFML/Window/Linux/WindowImplX11.cpp index abeecedbf..c6f8391e1 100644 --- a/src/SFML/Window/Linux/WindowImplX11.cpp +++ b/src/SFML/Window/Linux/WindowImplX11.cpp @@ -939,7 +939,7 @@ Keyboard::Key WindowImplX11::keysymToSF(KeySym symbol) case XK_9 : return Keyboard::Num9; } - return Keyboard::Key(0); + return Keyboard::Unknown; } } // namespace priv diff --git a/src/SFML/Window/OSX/HIDInputManager.mm b/src/SFML/Window/OSX/HIDInputManager.mm index 153365a2f..a23f431b7 100644 --- a/src/SFML/Window/OSX/HIDInputManager.mm +++ b/src/SFML/Window/OSX/HIDInputManager.mm @@ -1019,7 +1019,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode) // This key is ' on CH-FR, ) on FR and - on US layouts. // An unknown key. - default: return sf::Keyboard::KeyCount; + default: return sf::Keyboard::Unknown; } } diff --git a/src/SFML/Window/Win32/WindowImplWin32.cpp b/src/SFML/Window/Win32/WindowImplWin32.cpp index 77dd0f9ad..b68ba57ae 100644 --- a/src/SFML/Window/Win32/WindowImplWin32.cpp +++ b/src/SFML/Window/Win32/WindowImplWin32.cpp @@ -820,7 +820,7 @@ Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags) case '9' : return Keyboard::Num9; } - return Keyboard::Key(0); + return Keyboard::Unknown; }