Skip to content

Commit

Permalink
feat(android): Enhance how ENTER key is handled for FV and KMSample2
Browse files Browse the repository at this point in the history
  • Loading branch information
darcywong00 committed Nov 29, 2024
1 parent 80f0ec7 commit 44f2047
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
super.onStartInput(attribute, restarting);
KMManager.onStartInput(attribute, restarting);
KMManager.resetContext(KeyboardType.KEYBOARD_TYPE_SYSTEM);

// Determine special handling for ENTER key
int inputType = attribute.inputType;
KMManager.setEnterMode(attribute.imeOptions, inputType);

// User switched to a new input field so we should extract the text from input field
// and pass it to Keyman Engine together with selection range
InputConnection ic = getCurrentInputConnection();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ public void onStartInput(EditorInfo attribute, boolean restarting) {
KMManager.setBannerOptions(mayPredict);
}
}

// Determine special handling for ENTER key
KMManager.setEnterMode(attribute.imeOptions, inputType);

// User switched to a new input field so we should extract the text from input field
// and pass it to Keyman Engine together with selection range
InputConnection ic = getCurrentInputConnection();
Expand Down

0 comments on commit 44f2047

Please sign in to comment.