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

Commit c764f5f1 authored by Sean McCreary's avatar Sean McCreary
Browse files

Restore Meta+Backspace=Back keyboard shortcut

"Meta+Backspace" has been a keyboard shortcut for "Back" for many
years, but is missing from Android 16. Phones with thumb keyboards
always have a backspace key, but rarely have an ESC or left arrow
key. Restore the older shortcut for use on these thumb keyboards.

Change-Id: Ica2c21c76e8a9376b174a3dc9ed544d87cadc701
parent 3ca5f931
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.res.Resources
import android.hardware.input.InputManager
import android.hardware.input.KeyGlyphMap
import android.view.KeyEvent.KEYCODE_BACK
import android.view.KeyEvent.KEYCODE_DEL
import android.view.KeyEvent.KEYCODE_DPAD_LEFT
import android.view.KeyEvent.KEYCODE_ESCAPE
import android.view.KeyEvent.KEYCODE_H
@@ -158,8 +159,14 @@ constructor(@Main private val resources: Resources, private val inputManager: In
            }
        )
        // Back: go back to previous state (back button)
        //  - Meta + Backspace OR
        //  - Meta + Escape OR
        //  - Meta + Left arrow
        add(
            shortcutInfo(resources.getString(R.string.group_system_go_back)) {
                command(META_META_ON, KEYCODE_DEL)
            }
        )
        add(
            shortcutInfo(resources.getString(R.string.group_system_go_back)) {
                command(META_META_ON, KEYCODE_ESCAPE)
+2 −1
Original line number Diff line number Diff line
@@ -568,10 +568,11 @@ public final class KeyboardShortcutListSearch {
                        Arrays.asList(
                                Pair.create(KeyEvent.KEYCODE_TAB, KeyEvent.META_META_ON))),
                /* Back: go back to previous state (back button) */
                /* Meta + Escape, Meta + left arrow */
                /* Meta + Backspace, Meta + Escape, Meta + left arrow */
                new ShortcutKeyGroupMultiMappingInfo(
                        context.getString(R.string.group_system_go_back),
                        Arrays.asList(
                                Pair.create(KeyEvent.KEYCODE_DEL, KeyEvent.META_META_ON),
                                Pair.create(KeyEvent.KEYCODE_ESCAPE, KeyEvent.META_META_ON),
                                Pair.create(KeyEvent.KEYCODE_DPAD_LEFT, KeyEvent.META_META_ON))),
                /* Take a full screenshot: Meta + S */
+6 −0
Original line number Diff line number Diff line
@@ -146,6 +146,12 @@ final class InputGestureManager {
                        KeyGestureEvent.KEY_GESTURE_TYPE_TAKE_SCREENSHOT,
                        /* allowCaptureByFocusedWindow = */true
                ),
                createKeyGesture(
                        KeyEvent.KEYCODE_DEL,
                        KeyEvent.META_META_ON,
                        KeyGestureEvent.KEY_GESTURE_TYPE_BACK,
                        /* allowCaptureByFocusedWindow = */true
                ),
                createKeyGesture(
                        KeyEvent.KEYCODE_ESCAPE,
                        KeyEvent.META_META_ON,