(key: string, ctrl: boolean, meta: boolean, shift: boolean, alt: boolean)
| 49 | } |
| 50 | |
| 51 | function signature(key: string, ctrl: boolean, meta: boolean, shift: boolean, alt: boolean) { |
| 52 | const mask = (ctrl ? 1 : 0) | (meta ? 2 : 0) | (shift ? 4 : 0) | (alt ? 8 : 0) |
| 53 | return `${key}:${mask}` |
| 54 | } |
| 55 | |
| 56 | function signatureFromEvent(event: KeyboardEvent) { |
| 57 | return signature(normalizeKey(event.key), event.ctrlKey, event.metaKey, event.shiftKey, event.altKey) |
no outgoing calls
no test coverage detected