mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 04:30:09 -05:00
Warn when user tries to map a command to Shift+Keypad on Windows (#closes 1069)
This commit is contained in:
@@ -71,6 +71,24 @@ void KeybindingManager::bindKeyLocal(Key key,
|
||||
std::string name,
|
||||
std::string guiPath)
|
||||
{
|
||||
#ifdef WIN32
|
||||
const bool isShift = hasKeyModifier(modifier, KeyModifier::Shift);
|
||||
const bool isKeypad = key == Key::Keypad0 || key == Key::Keypad1 ||
|
||||
key == Key::Keypad2 || key == Key::Keypad3 || key == Key::Keypad4 ||
|
||||
key == Key::Keypad5 || key == Key::Keypad6 || key == Key::Keypad7 ||
|
||||
key == Key::Keypad8 || key == Key::Keypad9 || key == Key::KeypadEnter ||
|
||||
key == Key::KeypadAdd || key == Key::KeypadSubtract ||
|
||||
key == Key::KeypadMultiply || key == Key::KeypadDivide;
|
||||
|
||||
if (isShift && isKeypad) {
|
||||
LWARNINGC(
|
||||
"bindKey",
|
||||
"Windows does not support binding keys to Shift + Keyboard as it will "
|
||||
"internally convert these into Home, End, etc, keys."
|
||||
);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
_keyLua.insert({
|
||||
{ key, modifier },
|
||||
{
|
||||
@@ -90,6 +108,24 @@ void KeybindingManager::bindKey(Key key,
|
||||
std::string name,
|
||||
std::string guiPath)
|
||||
{
|
||||
#ifdef WIN32
|
||||
const bool isShift = hasKeyModifier(modifier, KeyModifier::Shift);
|
||||
const bool isKeypad = key == Key::Keypad0 || key == Key::Keypad1 ||
|
||||
key == Key::Keypad2 || key == Key::Keypad3 || key == Key::Keypad4 ||
|
||||
key == Key::Keypad5 || key == Key::Keypad6 || key == Key::Keypad7 ||
|
||||
key == Key::Keypad8 || key == Key::Keypad9 || key == Key::KeypadEnter ||
|
||||
key == Key::KeypadAdd || key == Key::KeypadSubtract ||
|
||||
key == Key::KeypadMultiply || key == Key::KeypadDivide;
|
||||
|
||||
if (isShift && isKeypad) {
|
||||
LWARNINGC(
|
||||
"bindKey",
|
||||
"Windows does not support binding keys to Shift + Keyboard as it will "
|
||||
"internally convert these into Home, End, etc, keys."
|
||||
);
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
_keyLua.insert({
|
||||
{ key, modifier },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user