summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--opentrack/global-shortcuts.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/opentrack/global-shortcuts.cpp b/opentrack/global-shortcuts.cpp
index e4cb7e0f..0fb5a2a5 100644
--- a/opentrack/global-shortcuts.cpp
+++ b/opentrack/global-shortcuts.cpp
@@ -1,8 +1,8 @@
#include <QList>
#include <QKeySequence>
#include <QVariant>
+#include <QDebug>
#include "global-shortcuts.h"
-#include <tuple>
#if defined(_WIN32)
# ifndef DIRECTINPUT_VERSION
@@ -113,12 +113,11 @@ QList<win_key> windows_key_sequences =
bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods)
{
auto qt = static_cast<QVariant>(qt_).toInt();
- const auto all_mods = Qt::KeyboardModifierMask;
- auto our_mods = qt & all_mods;
+ auto our_mods = qt & Qt::KeyboardModifierMask;
#ifdef _WIN32
const auto our_mods_ = our_mods;
our_mods |= Qt::ShiftModifier;
- switch (qt)
+ switch (qt & ~Qt::ShiftModifier)
{
case Qt::Key::Key_BraceLeft: qt = Qt::Key::Key_BracketLeft; break;
case Qt::Key::Key_BraceRight: qt = Qt::Key::Key_BracketRight; break;
@@ -146,7 +145,7 @@ bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods)
}
#endif
- const auto key = qt & ~all_mods;
+ const auto key = qt & ~Qt::KeyboardModifierMask;
for (auto& wk : windows_key_sequences)
{
if (wk.qt == key)