fixed invalid key detection

This commit is contained in:
Skycoder42
2017-09-30 19:21:26 +02:00
parent 91f3542b5d
commit 83910c8eca
5 changed files with 43 additions and 21 deletions
+7 -1
View File
@@ -279,7 +279,13 @@ bool QHotkeyPrivate::removeShortcutInvoked(QHotkey *hotkey)
QHotkey::NativeShortcut QHotkeyPrivate::nativeShortcutInvoked(Qt::Key keycode, Qt::KeyboardModifiers modifiers)
{
return {this->nativeKeycode(keycode), this->nativeModifiers(modifiers)};
bool ok1, ok2 = false;
auto k = nativeKeycode(keycode, ok1);
auto m = nativeModifiers(modifiers, ok2);
if(ok1 && ok2)
return {k, m};
else
return {};
}