ignore more keys on search page

This commit is contained in:
siikamiika 2019-10-26 15:15:12 +03:00
parent 9132814ccf
commit 50769feea7

View File

@ -104,17 +104,21 @@ class DisplaySearch extends Display {
let activeModifierMap = { let activeModifierMap = {
'Control': e.ctrlKey, '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 = { const ignoreKeys = {
undefined: ['Tab'], 'ANY_MOD': ['Tab', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'PageDown', 'PageUp', 'Home', 'End']
'Control': ['C', 'A', 'Z', 'Y', 'X', 'F'], .concat(
'Meta': ['C', 'A', 'Z', 'Y', 'X', 'F'], 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': [], 'OS': [],
'Alt': [], 'Alt': [],
'AltGraph': [],
'Shift': [] 'Shift': []
} }