1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1× 615× 615× 615× 615× 615× 615× 615× 615× | export {default as keys} from './keys' export function parseKeyEvent(event, onlyModifiers) { let frags = [] Iif (event.altKey) { if (event.code === 'AltRight') { frags.push('ALTGR') } else { frags.push('ALT') } } Iif (event.ctrlKey) frags.push('CTRL') Eif (event.metaKey) frags.push('META') Iif (event.shiftKey) frags.push('SHIFT') Eif (!onlyModifiers) { frags.push(event.keyCode) } return frags.join('+') } |