summaryrefslogtreecommitdiffstats
path: root/src/android/jar
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/jar')
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java6
-rw-r--r--src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java26
2 files changed, 31 insertions, 1 deletions
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
index 166786134b..d8456e7554 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtActivityDelegate.java
@@ -375,8 +375,12 @@ public class QtActivityDelegate
inputType |= android.text.InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
}
- if ((inputHints & ImhMultiLine) != 0)
+ if ((inputHints & ImhMultiLine) != 0) {
inputType |= android.text.InputType.TYPE_TEXT_FLAG_MULTI_LINE;
+ // Clear imeOptions for Multi-Line Type
+ // User should be able to insert new line in such case
+ imeOptions = android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
+ }
if ((inputHints & (ImhNoPredictiveText | ImhSensitiveData | ImhHiddenText)) != 0)
inputType |= android.text.InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
diff --git a/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java b/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
index e90de9e24d..6cf1aca5bf 100644
--- a/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
+++ b/src/android/jar/src/org/qtproject/qt/android/QtInputConnection.java
@@ -257,6 +257,32 @@ public class QtInputConnection extends BaseInputConnection
// If the sendKeyEvent was invoked, it means that the button not related with composingText was used
// In such case composing text (if it exists) should be finished immediately
finishComposingText();
+ if (event.getKeyCode() == KeyEvent.KEYCODE_ENTER && m_view != null) {
+ KeyEvent fakeEvent;
+ switch (m_view.m_imeOptions) {
+ case android.view.inputmethod.EditorInfo.IME_ACTION_NEXT:
+ fakeEvent = new KeyEvent(event.getDownTime(),
+ event.getEventTime(),
+ event.getAction(),
+ KeyEvent.KEYCODE_TAB,
+ event.getRepeatCount(),
+ event.getMetaState());
+ return super.sendKeyEvent(fakeEvent);
+
+ case android.view.inputmethod.EditorInfo.IME_ACTION_PREVIOUS:
+ fakeEvent = new KeyEvent(event.getDownTime(),
+ event.getEventTime(),
+ event.getAction(),
+ KeyEvent.KEYCODE_TAB,
+ event.getRepeatCount(),
+ KeyEvent.META_SHIFT_ON);
+ return super.sendKeyEvent(fakeEvent);
+
+ default:
+ break;
+ }
+ }
+
return super.sendKeyEvent(event);
}