Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
watchKeys(e, handler) {
e.preventDefault()
e.stopImmediatePropagation()
this.$shift.attr('pressed', hotkeys.shift)
this.$alt.attr('pressed', hotkeys[altKey === 'opt' ? 'alt' : altKey])
this.$cmd.attr('pressed', hotkeys[metaKey])
this.$up.attr('pressed', e.code === 'ArrowUp')
this.$down.attr('pressed', e.code === 'ArrowDown')
this.$left.attr('pressed', e.code === 'ArrowLeft')
this.$right.attr('pressed', e.code === 'ArrowRight')
const { negative, negative_modifier, side, amount } = this.createCommand({e, hotkeys})
$('[command]', this.$shadow)[0].innerHTML = this.displayCommand({
negative, negative_modifier, side, amount,
})
}