From 3a98a7ebc70602e28d1e17f31cf543f17dd8d836 Mon Sep 17 00:00:00 2001 From: Sergey Shebanin Date: Mon, 26 Jul 2021 09:10:29 +0000 Subject: [PATCH] [IMP] hotkey_service prefer physical keys for non-latin keyboard layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes odoo/odoo#74212 Signed-off-by: Géry Debongnie (ged) --- addons/web/static/src/core/hotkeys/hotkey_service.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/web/static/src/core/hotkeys/hotkey_service.js b/addons/web/static/src/core/hotkeys/hotkey_service.js index 754a75989db..4ca1fa1dea5 100644 --- a/addons/web/static/src/core/hotkeys/hotkey_service.js +++ b/addons/web/static/src/core/hotkeys/hotkey_service.js @@ -218,6 +218,10 @@ export const hotkeyService = { if (ev.code && ev.code.indexOf("Digit") === 0) { key = ev.code.slice(-1); } + // Prefer physical keys for non-latin keyboard layout. + if (!AUTHORIZED_KEYS.has(key) && ev.code && ev.code.indexOf("Key") === 0) { + key = ev.code.slice(-1).toLowerCase(); + } // Make sure we do not duplicate a modifier key if (!MODIFIERS.has(key)) { hotkey.push(key);