Warn when user tries to map a command to Shift+Keypad on Windows (#closes 1069)

This commit is contained in:
Alexander Bock
2020-02-10 18:38:07 +01:00
parent da8458ab40
commit f6507b9b57
+36
View File
@@ -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 },
{