From 18e86f3bf8308f71b865f5d8cef35c9ca17c59d5 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 21 Feb 2022 18:56:55 +0000 Subject: [PATCH] Fix non-customizable keybindings not working as expected (#7855) --- src/KeyBindingsDefaults.ts | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/KeyBindingsDefaults.ts b/src/KeyBindingsDefaults.ts index 76d55b42d3..e122b2dff8 100644 --- a/src/KeyBindingsDefaults.ts +++ b/src/KeyBindingsDefaults.ts @@ -30,9 +30,7 @@ import { KeyBindingAction, } from "./accessibility/KeyboardShortcuts"; -export const getBindingsByCategory = ( - category: CategoryName, -): KeyBinding[] => { +export const getBindingsByCategory = (category: CategoryName): KeyBinding[] => { return CATEGORIES[category].settingNames.reduce((bindings, name) => { const value = getCustomizableShortcuts()[name]?.default; if (value) { @@ -151,7 +149,16 @@ const roomBindings = (): KeyBinding[] => { }; const navigationBindings = (): KeyBinding[] => { - return getBindingsByCategory(CategoryName.NAVIGATION); + const bindings = getBindingsByCategory(CategoryName.NAVIGATION); + + bindings.push({ + action: "KeyBinding.closeDialogOrContextMenu" as KeyBindingAction, + keyCombo: { + key: Key.ESCAPE, + }, + }); + + return bindings; }; const labsBindings = (): KeyBinding[] => {