@@ -125,35 +125,37 @@ QKeySequence KeyboardEventFilter::getKeySeq(QKeyEvent* e) {
125125 return {};
126126 }
127127
128+ // Note: test for individual modifiers, don't use e->modifiers() for composing
129+ // the QKeySequence because on macOS arrow key events are sent with the Num
130+ // modifier for some reason. This result in a key sequence for which there
131+ // would be no match in our keyseq/control hash.
132+ // See https://github.com/mixxxdj/mixxx/issues/13305
133+ QString modseq;
134+ if (e->modifiers () & Qt::ShiftModifier) {
135+ modseq += " Shift+" ;
136+ }
137+ if (e->modifiers () & Qt::ControlModifier) {
138+ modseq += " Ctrl+" ;
139+ }
140+ if (e->modifiers () & Qt::AltModifier) {
141+ modseq += " Alt+" ;
142+ }
143+ if (e->modifiers () & Qt::MetaModifier) {
144+ modseq += " Meta+" ;
145+ }
146+
147+ const QString keyseq = QKeySequence (e->key ()).toString ();
148+ const QKeySequence k = QKeySequence (modseq + keyseq);
149+
128150 if (CmdlineArgs::Instance ().getDeveloper ()) {
129- QString modseq;
130- QKeySequence k;
131- if (e->modifiers () & Qt::ShiftModifier) {
132- modseq += " Shift+" ;
133- }
134- if (e->modifiers () & Qt::ControlModifier) {
135- modseq += " Ctrl+" ;
136- }
137- if (e->modifiers () & Qt::AltModifier) {
138- modseq += " Alt+" ;
139- }
140- if (e->modifiers () & Qt::MetaModifier) {
141- modseq += " Meta+" ;
142- }
143- QString keyseq = QKeySequence (e->key ()).toString ();
144- k = QKeySequence (modseq + keyseq);
145151 if (e->type () == QEvent::KeyPress) {
146152 qDebug () << " keyboard press: " << k.toString ();
147153 } else if (e->type () == QEvent::KeyRelease) {
148154 qDebug () << " keyboard release: " << k.toString ();
149155 }
150156 }
151157
152- #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
153- return QKeySequence (e->modifiers () | e->key ());
154- #else
155- return QKeySequence (e->modifiers () + e->key ());
156- #endif
158+ return k;
157159}
158160
159161void KeyboardEventFilter::setKeyboardConfig (ConfigObject<ConfigValueKbd>* pKbdConfigObject) {
0 commit comments