Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x 633x | /**
* Key definitions and whether the string renderer currently supports them.
* @type {Array<[string, string, boolean]>}
*/
const keyDefinitions = [
['enter', 'Enter', true],
['escape', 'Escape', true],
['esc', 'Escape', true],
['tab', 'Tab', true],
['space', ' ', true],
['delete', 'Delete', true],
['up', 'ArrowUp', false],
['down', 'ArrowDown', false],
['left', 'ArrowLeft', false],
['right', 'ArrowRight', false],
['backspace', 'Backspace', false],
];
/**
* Key names accepted by the compiled event renderer.
* @type {Map<string, string>}
*/
export const KEY_MODIFIERS = new Map(keyDefinitions.map(([name, key]) => [name, key]));
/**
* Existing string-renderer key support, drawn from the same definitions.
* @type {object}
*/
export const FALLBACK_KEY_MODIFIERS = Object.fromEntries(
keyDefinitions.filter(([, , fallback]) => fallback).map(([name, key]) => [name, key]),
);
/**
* System modifiers and their event properties.
* @type {object}
*/
export const SYSTEM_MODIFIERS = {
ctrl: 'ctrlKey',
alt: 'altKey',
shift: 'shiftKey',
meta: 'metaKey',
cmd: 'metaKey',
};
/**
* The accepted event modifier vocabulary across both renderers.
* @type {Set<string>}
*/
export const EVENT_MODIFIERS = new Set([
'prevent',
'stop',
'self',
'once',
'passive',
'capture',
...KEY_MODIFIERS.keys(),
...Object.keys(SYSTEM_MODIFIERS),
]);
|