(e: KeyboardEvent)
| 233 | |
| 234 | React.useEffect(() => { |
| 235 | const handleKeydown = (e: KeyboardEvent) => { |
| 236 | if (!isLegitKeypress(e)) return; |
| 237 | if (e.code !== 'KeyN' && e.code !== 'KeyP') return; |
| 238 | const newSelectedLine = moveUpDown(e.code === 'KeyN' ? 'up' : 'down', selectedLine, ops); |
| 239 | if (newSelectedLine !== undefined) { |
| 240 | setSelectedLine(newSelectedLine); |
| 241 | } |
| 242 | }; |
| 243 | document.addEventListener('keydown', handleKeydown); |
| 244 | return () => { |
| 245 | document.removeEventListener('keydown', handleKeydown); |
nothing calls this directly
no test coverage detected