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

Commit d9d4f11e authored by Jackal Guo's avatar Jackal Guo
Browse files

Start a11y shortcut via keyboard

Add keychord (Ctrl + Alt + Z) to start the accessibility shortcut.

Bug: 62225109
Test: Manually press the keychord and check if selected a11y
service is enabled/disabled.

Change-Id: I0ece7d7f04fb24087d6e90b8fcbee4be3e27f714
parent 72621aeb
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -6046,6 +6046,19 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            }
        }

        // Intercept the Accessibility keychord (CTRL + ALT + Z) for keyboard users.
        if (mAccessibilityShortcutController.isAccessibilityShortcutAvailable(isKeyguardLocked())) {
            switch (keyCode) {
                case KeyEvent.KEYCODE_Z: {
                    if (down && event.isCtrlPressed() && event.isAltPressed()) {
                        mHandler.sendMessage(mHandler.obtainMessage(MSG_ACCESSIBILITY_SHORTCUT));
                        result &= ~ACTION_PASS_TO_USER;
                    }
                    break;
                }
            }
        }

        if (useHapticFeedback) {
            performHapticFeedbackLw(null, HapticFeedbackConstants.VIRTUAL_KEY, false,
                    "Virtual Key - Press");