Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 975a5f7a authored by Byungsung You's avatar Byungsung You Committed by Vishnu Nair
Browse files

Process numpad enter key along with enter key.

Some views define only KEYCODE_ENTER action not KEYCODE_NUMPAD_ENTER.
because of this, when numpad enter key is pressed expected result is not shown.
We are adding KEYCODE_NUMPAD_ENTER to be processed in the same way as KEYCODE_ENTER.

Test: Check that adb shell input KEYCODE_NUMPAD_ENTER and adb shell input KEYCODE_ENTER

Bug: b/141329038

Change-Id: I87b5159c4fe71eaf8501059249c79b7cfd1752fc
parent 2bf744ab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -5863,6 +5863,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        case KeyEvent.KEYCODE_DPAD_RIGHT:
        case KeyEvent.KEYCODE_DPAD_CENTER:
        case KeyEvent.KEYCODE_ENTER:
        case KeyEvent.KEYCODE_NUMPAD_ENTER:
            okToSend = false;
            break;
        case KeyEvent.KEYCODE_BACK:
+1 −0
Original line number Diff line number Diff line
@@ -821,6 +821,7 @@ public class AutoCompleteTextView extends EditText implements Filter.FilterListe
            // was a click, the text view gets the selected item
            // from the drop down as its content
            case KeyEvent.KEYCODE_ENTER:
            case KeyEvent.KEYCODE_NUMPAD_ENTER:
            case KeyEvent.KEYCODE_DPAD_CENTER:
            case KeyEvent.KEYCODE_TAB:
                if (event.hasNoModifiers()) {
+1 −0
Original line number Diff line number Diff line
@@ -1005,6 +1005,7 @@ public class ListPopupWindow implements ShowableListMenu {
                        case KeyEvent.KEYCODE_DPAD_CENTER:
                        case KeyEvent.KEYCODE_DPAD_DOWN:
                        case KeyEvent.KEYCODE_DPAD_UP:
                        case KeyEvent.KEYCODE_NUMPAD_ENTER:
                            return true;
                    }
                } else {
+1 −0
Original line number Diff line number Diff line
@@ -1033,6 +1033,7 @@ public class NumberPicker extends LinearLayout {
        switch (keyCode) {
            case KeyEvent.KEYCODE_DPAD_CENTER:
            case KeyEvent.KEYCODE_ENTER:
            case KeyEvent.KEYCODE_NUMPAD_ENTER:
                removeAllCallbacks();
                break;
            case KeyEvent.KEYCODE_DPAD_DOWN:
+2 −1
Original line number Diff line number Diff line
@@ -1076,7 +1076,8 @@ public class SearchView extends LinearLayout implements CollapsibleActionView {
            // The search key is handled by the dialog's onKeyDown().
            if (!mSearchSrcTextView.isEmpty() && event.hasNoModifiers()) {
                if (event.getAction() == KeyEvent.ACTION_UP) {
                    if (keyCode == KeyEvent.KEYCODE_ENTER) {
                    if (keyCode == KeyEvent.KEYCODE_ENTER
                            || keyCode == KeyEvent.KEYCODE_NUMPAD_ENTER) {
                        v.cancelLongPress();

                        // Launch as a regular search.
Loading