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

Commit 61932f38 authored by Yohei Yukawa's avatar Yohei Yukawa
Browse files

Use Meta+Space for hard-keyboard layout switching

Currently we are not quite ready to have a system-level shortcut to
rotate IME language.  Until we become ready to do so, let's use
Meta+Space for hardware keyboard layout switching.

Fix: 79150878
Test: Manually tested as follows.
 1. Connect a hardware keyboard.
 2. Enable multiple hardware keyboard layouts.
 3. Make sure the hardware keyboard layout switches to the next one
    with Meta+Space.
 4. Make sure the hardware keyboard layout switches to the next one
    with Ctrl+Space.
 5. Make sure the hardware keyboard layout switches to the previous
    one with Shift+Ctrl+Space.
 6. Make sure the hardware keyboard layout switches to the previous
    one with Shift+Meta+Space.
Change-Id: Ife8a7100ec52792f4c42af2aa99298687c9af457
parent 86bcdd80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1725,8 +1725,8 @@
    <string name="keyboard_shortcut_group_system_notifications">Notifications</string>
    <!-- User visible title for the the keyboard shortcut that triggers the keyboard shortcuts helper. -->
    <string name="keyboard_shortcut_group_system_shortcuts_helper">Keyboard Shortcuts</string>
    <!-- User visible title for the the keyboard shortcut that switches input methods. -->
    <string name="keyboard_shortcut_group_system_switch_input">Switch input method</string>
    <!-- User visible title for the the keyboard shortcut that switches to the next hardware keyboard layout. [CHAR LIMIT=30] -->
    <string name="keyboard_shortcut_group_system_switch_input">Switch keyboard layout</string>

    <!-- User visible title for the system-wide applications keyboard shortcuts list. -->
    <string name="keyboard_shortcut_group_applications">Applications</string>
+3 −3
Original line number Diff line number Diff line
@@ -3986,10 +3986,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }

        // Handle keyboard language switching.
        final boolean isCtrlOrMetaSpace = keyCode == KeyEvent.KEYCODE_SPACE
                && (metaState & (KeyEvent.META_CTRL_MASK | KeyEvent.META_META_MASK)) != 0;
        if (down && repeatCount == 0
                && (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH
                        || (keyCode == KeyEvent.KEYCODE_SPACE
                                && (metaState & KeyEvent.META_CTRL_MASK) != 0))) {
                && (keyCode == KeyEvent.KEYCODE_LANGUAGE_SWITCH || isCtrlOrMetaSpace)) {
            int direction = (metaState & KeyEvent.META_SHIFT_MASK) != 0 ? -1 : 1;
            mWindowManagerFuncs.switchKeyboardLayout(event.getDeviceId(), direction);
            return -1;