Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.15.1
-
None
-
MacOS 10.5
Description
I want to capture shortcut Cmd+Plus to do something (zoom something). But as I found this does not work on MacBooks because Cmd+Plus has to be pressed with holding Shift key. So instead of Cmd+Plus I got Cmd+Shift+=. What is interesting: on Windows and Linux everything works as expected (Ctrl instead of Cmd, of course).
A piece of code:
#include <QApplication> #include <QDebug> #include <QKeyEvent> #include <QWidget> class Widget : public QWidget { public: void keyPressEvent(QKeyEvent *event) override { qInfo() << event->key() << event->modifiers(); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }
When I press Cmd+Plus (with holding Shift), this code outputs 61 QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) on my MacBook. Note that 61 is decadic number of '='.
This code outputs 43 QFlags<Qt::KeyboardModifier>(ShiftModifier|ControlModifier) on Windows and Linux notebooks which also require pressing Shift. But here 43 is '+'. Which is correct.
I did not find any way to check whether Cmd+Plus was pressed on MacBook. Since the behaviour is different on Mac vs Win/Linux, I consider this to be bug.