diff options
author | Richard Moe Gustavsen <richard.gustavsen@digia.com> | 2014-01-30 16:39:17 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-06 14:19:57 +0100 |
commit | 6b212351e239347a9c28cff79d9ee2ef316ac69d (patch) | |
tree | c6273ced7b5431f428e798dc4164fd3fdaa67050 /src/plugins | |
parent | 35dc77f8dbca0528bdab9ad7e4e1baa0769f5639 (diff) |
iOS: send backspace events directly
For legacy reasons, we send IM events to the focus
object directly instead of through QPA. To be consistent,
and to ensure that IM and key events end up at the same
object in the same order, we need to send key events
directly to the focus object as well.
We should consider fixing up QPA to support IM events
better, but this will do for now.
Change-Id: I8a18a1f7b7295e5c64a109fb98eee928fae06a0f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/ios/quiview_textinput.mm | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/platforms/ios/quiview_textinput.mm b/src/plugins/platforms/ios/quiview_textinput.mm index 46c63402a0..0d9113abc1 100644 --- a/src/plugins/platforms/ios/quiview_textinput.mm +++ b/src/plugins/platforms/ios/quiview_textinput.mm @@ -467,11 +467,13 @@ Q_GLOBAL_STATIC(StaticVariables, staticVariables); - (void)deleteBackward { - // Send key event to window system interface - QWindowSystemInterface::handleKeyEvent( - 0, QEvent::KeyPress, (int)Qt::Key_Backspace, Qt::NoModifier); - QWindowSystemInterface::handleKeyEvent( - 0, QEvent::KeyRelease, (int)Qt::Key_Backspace, Qt::NoModifier); + // Since we're posting im events directly to the focus object, we should do the + // same for key events. Otherwise they might end up in a different place or out + // of sync with im events. + QKeyEvent press(QEvent::KeyPress, (int)Qt::Key_Backspace, Qt::NoModifier); + QKeyEvent release(QEvent::KeyRelease, (int)Qt::Key_Backspace, Qt::NoModifier); + [self sendEventToFocusObject:press]; + [self sendEventToFocusObject:release]; } - (void)updateTextInputTraits |