fix(android): Add SEND, NEXT, PREVIOUS actions

This commit is contained in:
Darcy Wong 2024-08-09 14:51:45 +07:00
parent 74011e2d09
commit 786a1063ea
2 changed files with 31 additions and 1 deletions

View file

@ -167,11 +167,26 @@ public class KMKeyboardJSHandler {
ic.performEditorAction(EditorInfo.IME_ACTION_SEARCH);
break;
// Send action
case SEND :
ic.performEditorAction(EditorInfo.IME_ACTION_SEND);
break;
// Next action
case NEXT :
ic.performEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
// Done action
case DONE :
ic.performEditorAction(EditorInfo.IME_ACTION_DONE);
break;
// Previous action
case PREVIOUS :
ic.performEditorAction(EditorInfo.IME_ACTION_PREVIOUS);
break;
// Messaging apps
case NEWLINE :
// Send newline without advancing cursor

View file

@ -184,8 +184,11 @@ public final class KMManager {
public enum EnterModeType {
GO, // Go action
SEARCH, // Search action
NEWLINE, // Send newline character
SEND, // Send action
NEXT, // Next action
DONE, // Done action
PREVIOUS, // Previous action
NEWLINE, // Send newline character
DEFAULT, // Default ENTER action
}
@ -1287,10 +1290,22 @@ public final class KMManager {
value = EnterModeType.SEARCH;
break;
case EditorInfo.IME_ACTION_SEND:
value = EnterModeType.SEND;
break;
case EditorInfo.IME_ACTION_NEXT:
value = EnterModeType.NEXT;
break;
case EditorInfo.IME_ACTION_DONE:
value = EnterModeType.DONE;
break;
case EditorInfo.IME_ACTION_PREVIOUS:
value = EnterModeType.PREVIOUS;
break;
default:
value = EnterModeType.DEFAULT;
}