From 3a911929ba263a23eba0c343a4f7b343e7aa9af6 Mon Sep 17 00:00:00 2001 From: "Tim E. Real" Date: Sun, 5 Dec 2010 04:34:35 +0000 Subject: Some work on shortcuts. See ChangeLog. --- muse2/muse/widgets/shortcutcapturedialog.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'muse2/muse/widgets/shortcutcapturedialog.cpp') 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 #include +#include 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: -- cgit v1.2.3