(e: KeyboardEvent)
| 58 | useEffect(() => { |
| 59 | if (!listening) return; |
| 60 | function handler(e: KeyboardEvent) { |
| 61 | if (e.key === "Escape") { |
| 62 | setListening(false); |
| 63 | return; |
| 64 | } |
| 65 | const combo = captureKeyCombo(e); |
| 66 | if (combo) { |
| 67 | onRebind(combo); |
| 68 | setListening(false); |
| 69 | } |
| 70 | } |
| 71 | window.addEventListener("keydown", handler); |
| 72 | return () => window.removeEventListener("keydown", handler); |
| 73 | }, [listening, onRebind]); |
nothing calls this directly
no test coverage detected