(e: KeyboardEvent)
| 75 | |
| 76 | React.useEffect(() => { |
| 77 | const handleKeydown = (e: KeyboardEvent) => { |
| 78 | if (!isLegitKeypress(e)) return; |
| 79 | if (e.code == 'KeyW') { |
| 80 | updateOptions(options => ({ignoreAllSpace: !options.ignoreAllSpace})); |
| 81 | } else if (e.code == 'KeyB') { |
| 82 | updateOptions(options => ({ignoreSpaceChange: !options.ignoreSpaceChange})); |
| 83 | } |
| 84 | }; |
| 85 | document.addEventListener('keydown', handleKeydown); |
| 86 | return () => { |
| 87 | document.removeEventListener('keydown', handleKeydown); |
nothing calls this directly
no test coverage detected