Added a sf::Key::Unknown key code for unsupported keys

This commit is contained in:
Laurent Gomila 2012-07-09 23:26:37 +02:00
parent c3fb58b33f
commit 7faf5857ec
4 changed files with 5 additions and 4 deletions

View File

@ -47,7 +47,8 @@ public :
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
enum Key enum Key
{ {
A, ///< The A key Unknown = -1, ///< Unhandled key
A = 0, ///< The A key
B, ///< The B key B, ///< The B key
C, ///< The C key C, ///< The C key
D, ///< The D key D, ///< The D key

View File

@ -939,7 +939,7 @@ Keyboard::Key WindowImplX11::keysymToSF(KeySym symbol)
case XK_9 : return Keyboard::Num9; case XK_9 : return Keyboard::Num9;
} }
return Keyboard::Key(0); return Keyboard::Unknown;
} }
} // namespace priv } // namespace priv

View File

@ -1019,7 +1019,7 @@ Keyboard::Key HIDInputManager::nonLocalizedKeys(UniChar virtualKeycode)
// This key is ' on CH-FR, ) on FR and - on US layouts. // This key is ' on CH-FR, ) on FR and - on US layouts.
// An unknown key. // An unknown key.
default: return sf::Keyboard::KeyCount; default: return sf::Keyboard::Unknown;
} }
} }

View File

@ -820,7 +820,7 @@ Keyboard::Key WindowImplWin32::virtualKeyCodeToSF(WPARAM key, LPARAM flags)
case '9' : return Keyboard::Num9; case '9' : return Keyboard::Num9;
} }
return Keyboard::Key(0); return Keyboard::Unknown;
} }