(key: string)
| 55 | } |
| 56 | |
| 57 | function normalizeModifierKey(key: string): keyof ShortcutModifierState | null { |
| 58 | switch (key) { |
| 59 | case "Meta": |
| 60 | case "OS": |
| 61 | case "Command": |
| 62 | return "metaKey"; |
| 63 | case "Control": |
| 64 | return "ctrlKey"; |
| 65 | case "Alt": |
| 66 | case "Option": |
| 67 | return "altKey"; |
| 68 | case "Shift": |
| 69 | return "shiftKey"; |
| 70 | default: |
| 71 | return null; |
| 72 | } |
| 73 | } |
| 74 | |
| 75 | export function shortcutModifierStateAfterKeyboardEvent( |
| 76 | currentState: ShortcutModifierState, |
no outgoing calls
no test coverage detected