From ca6d5289333d301d1e86af273322e04c0db148ff Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Tue, 20 Sep 2022 18:00:28 +0900 Subject: [PATCH] Keyboard Shortcuts: fix settings sidebar toggle shortcut (#43428) * Keyboard Shortcuts: fix settings sidebar toggle shortcut * Consider Keyboard layouts --- packages/keycodes/src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/keycodes/src/index.js b/packages/keycodes/src/index.js index 8862c4c09ffa0..12ba73acdbf7a 100644 --- a/packages/keycodes/src/index.js +++ b/packages/keycodes/src/index.js @@ -372,6 +372,18 @@ export const isKeyboardEvent = mapValues( modifiers, ( getModifiers ) => { key = String.fromCharCode( event.keyCode ).toLowerCase(); } + // Replace some characters to match the key indicated + // by the shortcut on Windows. + if ( ! _isApple() ) { + if ( + event.shiftKey && + character.length === 1 && + event.code === 'Comma' + ) { + key = ','; + } + } + // For backwards compatibility. if ( character === 'del' ) { character = 'delete';