diff options
author | Andy Shaw <andy.shaw@qt.io> | 2021-02-05 11:59:02 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-23 10:50:18 +0000 |
commit | 7f22edc00cf9b72aa95fbb2f1e60dcf7f65d3e60 (patch) | |
tree | ca9ee7e775b6ef40b2cb33870fbee1d0c40c8c45 /src/plugins | |
parent | a363e1e8ea416f72380668f483661cef0b526448 (diff) |
iOS: Pass the text to handleExtendedKeyEvent when known
This will ensure that the QKeyEvent also has this information passed on
as appropriate.
Change-Id: I52436404115b453664b9b3414f8ec4e715dd6a28
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 5540c9c10754963375cd34f740e64b068c440a3e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/quiview.mm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index d1cd3f3ca0..c7f94cc707 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -574,7 +574,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") QWindowSystemInterface::handleTouchCancelEvent(self.platformWindow->window(), ulong(timestamp * 1000), iosIntegration->touchDevice()); } -- (int)mapPressTypeToKey:(UIPress*)press withModifiers:(Qt::KeyboardModifiers)qtModifiers +- (int)mapPressTypeToKey:(UIPress*)press withModifiers:(Qt::KeyboardModifiers)qtModifiers text:(QString &)text { switch (press.type) { case UIPressTypeUpArrow: return Qt::Key_Up; @@ -592,7 +592,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") if (key != Qt::Key_unknown) return key; return QAppleKeyMapper::fromNSString(qtModifiers, press.key.characters, - charactersIgnoringModifiers); + charactersIgnoringModifiers, text); } #endif return Qt::Key_unknown; @@ -611,11 +611,14 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") if (@available(ios 13.4, *)) qtModifiers = QAppleKeyMapper::fromUIKitModifiers(press.key.modifierFlags); #endif - int key = [self mapPressTypeToKey:press withModifiers:qtModifiers]; + QString text; + int key = [self mapPressTypeToKey:press withModifiers:qtModifiers text:text]; if (key == Qt::Key_unknown) continue; - if (QWindowSystemInterface::handleKeyEvent(self.platformWindow->window(), type, key, qtModifiers)) + if (QWindowSystemInterface::handleKeyEvent(self.platformWindow->window(), type, key, + qtModifiers, text)) { handled = true; + } } return handled; |