Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Could you explain me the QKeyEvent::nativeModifiers() and key() methods ?
Folco last edited by Folco
I'm using Windows.
I use Qt Creator 4.0.2, (Qt 5.7.0)
I'm currently writing a custom widget which needs it's own key handler. No problem to install it, using QKeyEvent.
My questions are about two methods of this class.
The questions are :
- where is that structure documented ?
- why the nativeModifiers() method don't return the native modifiers, as described in the WinAPI doc. Reading the source of translateKeyEventInternal shows that the real native codes are returned for nativeVirtualKey() and nativeScanCode (see lParam and wParam), why not for nativeModifiers() ?
- is there a way to get the real native modifiers ?
- QKeyEvent::key() should return the Qt::Key who triggered the event.
So when pressing a single key, let say 'D', I should get 0x44 (Qt::Key_D). But I get 0x6B7CDF4F
When I press Shift, I get 0x6BC7DF4F.
Could you explain me that behaviour, please, I can't figure out how it works...
Thanks in advance, I spent a lot of hours in the docs and in the source without success. Any help will be appreciated :)