From c7fcf2a93697d7e7bf51c1918e27cea15e6b6e42 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Tue, 30 Mar 2021 20:00:12 +0200 Subject: [PATCH] Fix broken "Go to Home View" shortcut on macOS The previous shortcut CMD+OPT+H is already bound by the system (hide other windows) and cannot be overridden. This commit changes the shortcut to CTRL+SHIFT+H on macOS while keeping CTRL+ALT+H on other platforms. Note that both CTRL+OPT+H (hide cursor) and CTRL+H (delete previous character) are bound by the system as well and wouldn't have worked as a replacement. Fixes: vector-im/element-web#16692 Signed-off-by: Johannes Marbach --- src/KeyBindingsDefaults.ts | 6 +++--- src/accessibility/KeyboardShortcuts.tsx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/KeyBindingsDefaults.ts b/src/KeyBindingsDefaults.ts index 0e9d14ea8f..002c12aec5 100644 --- a/src/KeyBindingsDefaults.ts +++ b/src/KeyBindingsDefaults.ts @@ -360,11 +360,11 @@ const navigationBindings = (): KeyBinding[] => { action: NavigationAction.GoToHome, keyCombo: { key: Key.H, - ctrlOrCmd: true, - altKey: true, + ctrlKey: true, + altKey: !isMac, + shiftKey: isMac, }, }, - { action: NavigationAction.SelectPrevRoom, keyCombo: { diff --git a/src/accessibility/KeyboardShortcuts.tsx b/src/accessibility/KeyboardShortcuts.tsx index 7a0ba58c97..2a3e576e31 100644 --- a/src/accessibility/KeyboardShortcuts.tsx +++ b/src/accessibility/KeyboardShortcuts.tsx @@ -265,7 +265,7 @@ const shortcuts: Record = { description: _td("Toggle this dialog"), }, { keybinds: [{ - modifiers: [CMD_OR_CTRL, Modifiers.ALT], + modifiers: [Modifiers.CONTROL, isMac ? Modifiers.SHIFT : Modifiers.ALT], key: Key.H, }], description: _td("Go to Home View"),