Home > OS >  QTest::sendKeyEvent on Mac with a real (native) Ctrl modifier
QTest::sendKeyEvent on Mac with a real (native) Ctrl modifier

Time:06-23

QTest::sendKeyEvent(...Qt::ControlModifier) causes a Command Key sent on Mac (and vice versa all QKeyEvents on Mac having Command pressed report the Qt::ControlModifier). What I need to do in order to achieve a real Ctrl key sending ?

CodePudding user response:

Two solutions exists:

As mentioned in the docs, this mapping is normally expected by macOS users, as shortcuts are normally using the Command key instead of the Control (which is used on other platforms).

References:

  • Related