Source

Target

Commits (1)
  • Andy Shaw's avatar
    FullScreenMode: Send return key without modifiers · 7683c588
    Andy Shaw authored
    
    When the return key is sent to a multiple line text field it can be
    interpreted differently if the Shift modifier is included. This makes
    sense for a hard keyboard as you can use it to enter in a new line
    versus a new paragraph. For the virtual keyboard however, it is best to
    just send it as a plain return so it handles it correctly.
    
    Change-Id: I995504d7ab6961fd8baf016d2d68be4b659d1e19
    Reviewed-by: default avatarMitch Curtis <mitch.curtis@qt.io>
    7683c588
Showing with 15 additions and 1 deletion
...@@ -63,7 +63,8 @@ bool DefaultInputMethod::setTextCase(InputEngine::TextCase textCase) ...@@ -63,7 +63,8 @@ bool DefaultInputMethod::setTextCase(InputEngine::TextCase textCase)
bool DefaultInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers) bool DefaultInputMethod::keyEvent(Qt::Key key, const QString &text, Qt::KeyboardModifiers modifiers)
{ {
inputContext()->sendKeyClick(key, text, modifiers); const Qt::KeyboardModifiers mods = (key == Qt::Key_Return) ? Qt::NoModifier : modifiers;
inputContext()->sendKeyClick(key, text, mods);
return true; return true;
} }
......
...@@ -1858,5 +1858,18 @@ Rectangle { ...@@ -1858,5 +1858,18 @@ Rectangle {
} }
} }
function test_fullScreenModeReturnKey() {
prepareTest()
textInput.text = ""
textInput.inputMethodHints = Qt.ImhUppercaseOnly
inputPanel.setFullScreenMode(true)
waitForRendering(inputPanel)
inputPanel.shadowInputControlVisibleSpy.wait()
verify(inputPanel.virtualKeyClick(Qt.Key_A))
verify(inputPanel.virtualKeyClick(Qt.Key_Return))
compare(inputPanel.shadowInput.text, "")
}
} }
} }