mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 12:51:05 +08:00
Added a sf::Key::Unknown key code for unsupported keys
This commit is contained in:
parent
c3fb58b33f
commit
7faf5857ec
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user