From 7224592458521a0c2312fcc29e33764c271cd4dc Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 25 Jul 2015 06:34:44 +0200 Subject: shortcuts: fix shift-keys for real this time --- opentrack/global-shortcuts.cpp | 9 ++++----- 1 file 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 #include #include +#include #include "global-shortcuts.h" -#include #if defined(_WIN32) # ifndef DIRECTINPUT_VERSION @@ -113,12 +113,11 @@ QList windows_key_sequences = bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods) { auto qt = static_cast(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) -- cgit v1.2.3