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 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> (cherry picked from commit 137ba2aba858bc32350e82ef6a1da91266c7f432) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
3a991c1529
commit
98edfa18c1
@ -240,6 +240,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;
|
||||
@ -275,11 +278,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…
x
Reference in New Issue
Block a user