Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,20 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {

private fun handleReturnKey() {
currentInputEditorInfo.run {
if (inputType and InputType.TYPE_MASK_CLASS == InputType.TYPE_NULL) {
if (inputType and InputType.TYPE_MASK_CLASS == InputType.TYPE_NULL ||
imeOptions.hasFlag(EditorInfo.IME_FLAG_NO_ENTER_ACTION)
) {
sendDownUpKeyEvents(KeyEvent.KEYCODE_ENTER)
return
}
if (imeOptions.hasFlag(EditorInfo.IME_FLAG_NO_ENTER_ACTION)) {
val ic = currentInputConnection
ic?.commitText("\n", 1)
return
}
if (!actionLabel.isNullOrEmpty() && actionId != EditorInfo.IME_ACTION_UNSPECIFIED) {
currentInputConnection.performEditorAction(actionId)
return
}
when (val action = imeOptions and EditorInfo.IME_MASK_ACTION) {
EditorInfo.IME_ACTION_UNSPECIFIED, EditorInfo.IME_ACTION_NONE -> currentInputConnection.commitText("\n", 1)
EditorInfo.IME_ACTION_UNSPECIFIED,
EditorInfo.IME_ACTION_NONE,
-> sendDownUpKeyEvents(KeyEvent.KEYCODE_ENTER)
else -> currentInputConnection.performEditorAction(action)
}
}
Expand Down
Loading