From d70d8aa99072afa75f9480cee59badee327fb5da Mon Sep 17 00:00:00 2001 From: Timur Ismagilov Date: Sat, 7 Sep 2024 21:35:22 +0300 Subject: [PATCH] Revert "Make shortcuts work outside of English layout (#227)" This reverts commit b43f2836c12d54a60f6250ad7d77659d29841492. --- web/static/shortcuts.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/web/static/shortcuts.js b/web/static/shortcuts.js index 9dcd577..99073e3 100644 --- a/web/static/shortcuts.js +++ b/web/static/shortcuts.js @@ -57,23 +57,9 @@ rrh.shortcuts = { if ((!event.ctrlKey && !event.metaKey && !event.altKey) && event.target instanceof Node && isTextField(event.target)) return - let possibleShortcuts = [keyEventToShortcut(event)] - if (event.code.startsWith('Key')) { - possibleShortcuts.push(keyEventToShortcut({ - ...event, - key: event.code.replace(/^Key/, '').toLowerCase(), - })) - } + let shortcut = keyEventToShortcut(event) - let shortcut = null - for (let possibleShortcut of possibleShortcuts) { - if (possibleShortcut in this.active) { - shortcut = possibleShortcut - break - } - } - - if (shortcut === null) { + if (!this.active[shortcut]) { this._resetActive() return }