Added support for numpad enter

This commit is contained in:
M66B 2023-10-13 10:22:05 +02:00
parent 70c27d6712
commit bc552ab506
3 changed files with 5 additions and 1 deletions

View File

@ -4697,6 +4697,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
case KeyEvent.KEYCODE_DPAD_CENTER:
case KeyEvent.KEYCODE_BUTTON_A:
boolean expanded = properties.getValue("expanded", message.id);

View File

@ -7953,6 +7953,7 @@ public class FragmentCompose extends FragmentBase {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_S:
case KeyEvent.KEYCODE_ENTER:
case KeyEvent.KEYCODE_NUMPAD_ENTER:
onAction(R.id.action_check, "key");
return true;
case KeyEvent.KEYCODE_B:

View File

@ -579,7 +579,9 @@ public class FragmentDialogSearch extends FragmentDialogBase {
etQuery.setOnEditorActionListener(new TextView.OnEditorActionListener() {
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_GO ||
(event != null && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
(event != null &&
(event.getKeyCode() == KeyEvent.KEYCODE_ENTER ||
event.getKeyCode() == KeyEvent.KEYCODE_NUMPAD_ENTER))) {
dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
return true;
}