diff options
author | Tim E. Real <termtech@rogers.com> | 2010-12-05 04:34:35 +0000 |
---|---|---|
committer | Tim E. Real <termtech@rogers.com> | 2010-12-05 04:34:35 +0000 |
commit | 3a911929ba263a23eba0c343a4f7b343e7aa9af6 (patch) | |
tree | 588260d0fe9b7147d2a8c358ad0a9f40fa80bb66 /muse2/muse/widgets/shortcutcapturedialog.cpp | |
parent | 94ded795771b0e2aeb33147056036ea5b4cce0d0 (diff) |
Some work on shortcuts. See ChangeLog.
Diffstat (limited to 'muse2/muse/widgets/shortcutcapturedialog.cpp')
-rw-r--r-- | muse2/muse/widgets/shortcutcapturedialog.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp index 07482bbd..ef2bc33e 100644 --- a/muse2/muse/widgets/shortcutcapturedialog.cpp +++ b/muse2/muse/widgets/shortcutcapturedialog.cpp @@ -14,6 +14,7 @@ #include <QKeyEvent> #include <QKeySequence> +#include <QInputEvent> ShortcutCaptureDialog::ShortcutCaptureDialog(QWidget* parent, int index) : QDialog(parent) @@ -39,14 +40,14 @@ void ShortcutCaptureDialog::keyPressEvent(QKeyEvent* e) bool shift, alt, ctrl, conflict = false, realkey = false; QString msgString = ""; int temp_key; - shift = e->state() & Qt::ShiftModifier; - ctrl = e->state() & Qt::ControlModifier; - alt = e->state() & Qt::AltModifier; + shift = ((QInputEvent*)e)->modifiers() & Qt::ShiftModifier; + ctrl = ((QInputEvent*)e)->modifiers() & Qt::ControlModifier; + alt = ((QInputEvent*)e)->modifiers() & Qt::AltModifier; //printf("Key total: %d, alt: %d, ctrl: %d shift: %d\n",e->key(), alt, ctrl, shift); temp_key = e->key(); - temp_key += (shift ? Qt::SHIFT : 0); - temp_key += (ctrl ? Qt::CTRL : 0); - temp_key += (alt ? Qt::ALT : 0); + temp_key += (shift ? (int)Qt::SHIFT : 0); // (int) Tim + temp_key += (ctrl ? (int)Qt::CTRL : 0); // + temp_key += (alt ? (int)Qt::ALT : 0); // //printf("Final key assembled: %d\n",temp_key); // Check if this is a "real" key that completes a valid shortcut: |