Skip to content

Commit

Permalink
fix(android): Add SEND, NEXT, PREVIOUS actions
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Aug 9, 2024
1 parent 74011e2 commit 786a106
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,26 @@ public void run() {
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
Expand Down
17 changes: 16 additions & 1 deletion android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,11 @@ public String toString() {
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
}

Expand Down Expand Up @@ -1287,10 +1290,22 @@ public static void setEnterMode(int imeOptions, int inputType) {
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;
}
Expand Down

0 comments on commit 786a106

Please sign in to comment.