From 064050893c4707d34e3a485907b3a5e9d1b0fbf8 Mon Sep 17 00:00:00 2001 From: Jesse Jafa Date: Sun, 3 May 2020 11:42:10 +0300 Subject: [PATCH 1/2] =?UTF-8?q?ALT-O=20Keyboard=20shortcut=20fix.=20Issue:?= =?UTF-8?q?=20#=C2=96888?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/use-keyboard-controls.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hooks/use-keyboard-controls.js b/src/hooks/use-keyboard-controls.js index 1c4717757..69e25e22a 100644 --- a/src/hooks/use-keyboard-controls.js +++ b/src/hooks/use-keyboard-controls.js @@ -37,8 +37,9 @@ const useKeyboardControls = ({ e.preventDefault(); } } - if (!!e.altKey && isMacOS()) { - switch (e.key) { + if (e.altKey && isMacOS()) { + const key = e.key.toUpperCase(); + switch (key) { case 'ø': toggleMode('overviewMode'); break; @@ -51,8 +52,9 @@ const useKeyboardControls = ({ default: null; } - } else if (!!e.altKey && !!e.shiftKey && isWindows()) { - switch (e.key) { + } else if (e.altKey && isWindows()) { + const key = e.key.toUpperCase(); + switch (key) { case 'O': toggleMode('overviewMode'); break; From 98cd5f453205bac08f67d9b8b430e06123aec6d2 Mon Sep 17 00:00:00 2001 From: Kylie Stewart Date: Mon, 11 May 2020 13:15:29 -0600 Subject: [PATCH 2/2] Assess macos key commands as lowercase --- src/hooks/use-keyboard-controls.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/use-keyboard-controls.js b/src/hooks/use-keyboard-controls.js index 69e25e22a..e32492373 100644 --- a/src/hooks/use-keyboard-controls.js +++ b/src/hooks/use-keyboard-controls.js @@ -38,7 +38,7 @@ const useKeyboardControls = ({ } } if (e.altKey && isMacOS()) { - const key = e.key.toUpperCase(); + const key = e.key.toLowerCase(); switch (key) { case 'ø': toggleMode('overviewMode');