Catch Enter key events & ignore events we don't understand.

Fixes issue #443
This commit is contained in:
John Maguire 2010-06-29 18:44:36 +00:00
parent 2d64703ee8
commit 88be9986f1
1 changed files with 4 additions and 0 deletions

View File

@ -78,6 +78,7 @@ class MacGlobalShortcutBackendPrivate : boost::noncopyable {
case 0x09: key = Qt::Key_Tab; break;
case 0x0d: key = Qt::Key_Return; break;
case 0x08: key = Qt::Key_Backspace; break;
case 0x03: key = Qt::Key_Enter; break;
}
if (key == 0) {
@ -218,6 +219,9 @@ void MacGlobalShortcutBackend::MacMediaKeyPressed(int key) {
}
void MacGlobalShortcutBackend::KeyPressed(const QKeySequence& sequence) {
if (sequence.isEmpty()) {
return;
}
QAction* action = shortcuts_[sequence];
if (action) {
action->trigger();