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

Commit e4feb2c7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add desktop switch shortcuts to shortcut helper" into main

parents 25929b52 e4bb9817
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2513,6 +2513,8 @@
    <string name="system_desktop_mode_toggle_maximize_window">Maximize window</string>
    <!-- User visible title for the keyboard shortcut that minimizes a task in desktop mode [CHAR LIMIT=70] -->
    <string name="system_desktop_mode_minimize_window">Minimize window</string>
    <!-- User visible title for the keyboard shortcut that switches between desktops in multiple desktop mode [CHAR LIMIT=70] -->
    <string name="system_multiple_desktop_mode_switch_between_desks">Move between desktops</string>

    <!-- User visible title for the input keyboard shortcuts list. [CHAR LIMIT=70] -->
    <string name="keyboard_shortcut_group_input">Input</string>
+22 −0
Original line number Diff line number Diff line
@@ -129,5 +129,27 @@ constructor(@Main private val resources: Resources, @Application private val con
                }
            )
        }

        if (
            DesktopModeStatus.enableMultipleDesktops(context) &&
                DesktopExperienceFlags.ENABLE_KEYBOARD_SHORTCUTS_TO_SWITCH_DESKS.isTrue
        ) {
            // Move between desktops
            //  - Meta + Ctrl + [ or ]
            add(
                shortcutInfo(
                    resources.getString(R.string.system_multiple_desktop_mode_switch_between_desks)
                ) {
                    command(META_META_ON or META_CTRL_ON, KEYCODE_LEFT_BRACKET)
                }
            )
            add(
                shortcutInfo(
                    resources.getString(R.string.system_multiple_desktop_mode_switch_between_desks)
                ) {
                    command(META_META_ON or META_CTRL_ON, KEYCODE_RIGHT_BRACKET)
                }
            )
        }
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ class ShortcutHelperExclusions @Inject constructor(private val context: Context)
            listOf(
                context.getString(R.string.group_system_cycle_forward),
                context.getString(R.string.group_system_cycle_back),
                context.getString(R.string.system_multiple_desktop_mode_switch_between_desks),
            )

    fun isShortcutCustomizable(label: String) = !nonCustomizableShortcutsLabels.contains(label)