From 50769feea71943051eaf12f1d96bc6305746959f Mon Sep 17 00:00:00 2001 From: siikamiika Date: Sat, 26 Oct 2019 15:15:12 +0300 Subject: [PATCH] ignore more keys on search page --- ext/bg/js/search.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/ext/bg/js/search.js b/ext/bg/js/search.js index 1a6822f6..6481e16a 100644 --- a/ext/bg/js/search.js +++ b/ext/bg/js/search.js @@ -104,17 +104,21 @@ class DisplaySearch extends Display { let activeModifierMap = { 'Control': e.ctrlKey, - 'Meta': e.metaKey + 'Meta': e.metaKey, + 'ANY_MOD': true }; - // true if no known modifier is pressed - activeModifierMap[undefined] = !Object.values(activeModifierMap).includes(true); const ignoreKeys = { - undefined: ['Tab'], - 'Control': ['C', 'A', 'Z', 'Y', 'X', 'F'], - 'Meta': ['C', 'A', 'Z', 'Y', 'X', 'F'], + 'ANY_MOD': ['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageDown', 'PageUp', 'Home', 'End'] + .concat( + Array.from(Array(24).keys()) + .map(i => `F${i + 1}`) + ), + 'Control': ['C', 'A', 'Z', 'Y', 'X', 'F', 'G'], + 'Meta': ['C', 'A', 'Z', 'Y', 'X', 'F', 'G'], 'OS': [], 'Alt': [], + 'AltGraph': [], 'Shift': [] }