Initialize member variables before we check their values
Amends 51679efcf97dfea86431912eeb9489088c0804ed, which broke Ctrl+key handling so that the key was not translated based on the alphanumerical character anymore. Fixes: QTBUG-97713 Pick-to: 6.2 Change-Id: I9835fd7af99693aae636ba3c4c114ef8e11621e9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>bb10
parent
1a44090df5
commit
137ba2aba8
|
|
@ -234,6 +234,9 @@
|
|||
KeyEvent::KeyEvent(NSEvent *nsevent)
|
||||
{
|
||||
timestamp = nsevent.timestamp * 1000;
|
||||
nativeModifiers = nsevent.modifierFlags;
|
||||
nativeVirtualKey = nsevent.keyCode;
|
||||
modifiers = QAppleKeyMapper::fromCocoaModifiers(nativeModifiers);
|
||||
|
||||
switch (nsevent.type) {
|
||||
case NSEventTypeKeyDown: type = QEvent::KeyPress; break;
|
||||
|
|
@ -269,11 +272,6 @@ KeyEvent::KeyEvent(NSEvent *nsevent)
|
|||
|
||||
isRepeat = nsevent.ARepeat;
|
||||
}
|
||||
|
||||
nativeVirtualKey = nsevent.keyCode;
|
||||
|
||||
nativeModifiers = nsevent.modifierFlags;
|
||||
modifiers = QAppleKeyMapper::fromCocoaModifiers(nativeModifiers);
|
||||
}
|
||||
|
||||
bool KeyEvent::sendWindowSystemEvent(QWindow *window) const
|
||||
|
|
|
|||
Loading…
Reference in New Issue