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

Alan Ezust alan.ezust at gmail.com
Mon Sep 21 22:11:50 CEST 2015


Ok, since Qt works as advertised, I suppose one could argue if there is a
bug or not, but I still think that when the user types arrow keys from the
mac keyboard(s), they should just register as plain old arrow keys without
modifiers or any kind of numeric-keypad reference. And that is how things
work from Java.


On Sat, Sep 19, 2015 at 4:04 AM, Elvis Stansvik <elvstone at gmail.com> wrote:

> 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
> >
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20150921/bce9de44/attachment.html>


More information about the Interest mailing list