Merge pull request #12745 from keymanapp/feat/fv/enter-key

feat(android): Enhance how ENTER key is handled for FV and KMSample2
This commit is contained in:
Darcy Wong 2024-12-03 13:34:26 +07:00 committed by GitHub
commit 7794d2d97b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -130,6 +130,11 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
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();

View file

@ -150,6 +150,10 @@ public class SystemKeyboard extends InputMethodService implements OnKeyboardEven
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();