(key: string)
| 62 | */ |
| 63 | |
| 64 | const create = (key: string) => { |
| 65 | const generic = HOTKEYS[key] |
| 66 | const apple = APPLE_HOTKEYS[key] |
| 67 | const windows = WINDOWS_HOTKEYS[key] |
| 68 | const isGeneric = generic && isKeyHotkey(generic) |
| 69 | const isApple = apple && isKeyHotkey(apple) |
| 70 | const isWindows = windows && isKeyHotkey(windows) |
| 71 | |
| 72 | return (event: KeyboardEvent) => { |
| 73 | if (isGeneric && isGeneric(event)) return true |
| 74 | if (IS_APPLE && isApple && isApple(event)) return true |
| 75 | if (!IS_APPLE && isWindows && isWindows(event)) return true |
| 76 | return false |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * Hotkeys. |
no outgoing calls
no test coverage detected