[Interest] MacOSx: Qt::KeypadModifier for arrow keys?

Elvis Stansvik elvstone at gmail.com
Sat Sep 19 13:04:32 CEST 2015


Hi Alan,

2015-09-18 22:52 GMT+02:00 Alan Ezust <alan.ezust at gmail.com>:
> I am running a keyboard test program on the MacOS
> with Qt 5.4 on MacOSx 10.10.5, Clang.
> All it does is print out the modifiers and the keycodes when I type arrow
> keys.
>
>
> void Dialog::keyPressEvent(QKeyEvent *ke) {
>
>     qDebug() << "event: " << ke->modifiers() << ke->key();
>
>
>
> }
>
>
> event: QFlags(0x20000000) 16777234
>
> event: QFlags(0x20000000) 16777236
>
> event: QFlags(0x20000000) 16777235
>
> event: QFlags(0x20000000) 16777237
>
>
> Why is the keypad modifier always selected for regular arrow keypress events
> on the mac?

>From the documentation [1]:

"Note: On OS X, the ControlModifier value corresponds to the Command
keys on the Macintosh keyboard, and the MetaModifier value corresponds
to the Control keys. The KeypadModifier value will also be set when an
arrow key is pressed as the arrow keys are considered part of the
keypad."

So what you're seeing is documented behavior on OS X. Now don't ask me
why. Someone else will have to answer :)

Cheers,
Elvis

[1] http://doc.qt.io/qt-5/qt.html#KeyboardModifier-enum

>
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>



More information about the Interest mailing list