From 7be318b0ed09705bfbc62adc25c8b1a399b1f656 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 25 Oct 2015 16:43:31 +0100 Subject: win32: try win_key with modifier first --- opentrack/win32-shortcuts.cpp | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/opentrack/win32-shortcuts.cpp b/opentrack/win32-shortcuts.cpp index 1f1d51a4..a0ed51b3 100644 --- a/opentrack/win32-shortcuts.cpp +++ b/opentrack/win32-shortcuts.cpp @@ -166,16 +166,27 @@ bool win_key::from_qt(QKeySequence qt_, int& dik, Qt::KeyboardModifiers& mods) auto our_mods = qt & Qt::KeyboardModifierMask; { + const auto key_ = qt; + for (auto& wk : windows_key_sequences) + { + if (wk.qt == key_) + { + dik = wk.win; + mods = Qt::NoModifier; + return true; + } + } } - - const auto key = qt & ~Qt::KeyboardModifierMask; - for (auto& wk : windows_key_sequences) { - if (wk.qt == key) + const auto key = qt & ~Qt::KeyboardModifierMask; + for (auto& wk : windows_key_sequences) { - dik = wk.win; - mods = static_cast(our_mods); - return true; + if (wk.qt == key) + { + dik = wk.win; + mods = static_cast(our_mods); + return true; + } } } return false; -- cgit v1.2.3