MCPcopy Create free account
hub / github.com/pingdotgg/t3code / captureKeybinding

Function captureKeybinding

apps/web/src/components/ProjectScriptsControl.tsx:148–158  ·  view source on GitHub ↗
(event: KeyboardEvent<HTMLInputElement>)

Source from the content-addressed store, hash-verified

146 "data-highlighted:bg-transparent data-highlighted:text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-highlighted:hover:bg-accent data-highlighted:hover:text-accent-foreground data-highlighted:focus-visible:bg-accent data-highlighted:focus-visible:text-accent-foreground";
147
148 const captureKeybinding = (event: KeyboardEvent<HTMLInputElement>) => {
149 if (event.key === "Tab") return;
150 event.preventDefault();
151 if (event.key === "Backspace" || event.key === "Delete") {
152 setKeybinding("");
153 return;
154 }
155 const next = keybindingFromKeyboardEvent(event, navigator.platform);
156 if (!next) return;
157 setKeybinding(next);
158 };
159
160 const submitAddScript = async (event: FormEvent) => {
161 event.preventDefault();

Callers

nothing calls this directly

Calls 2

preventDefaultMethod · 0.80

Tested by

no test coverage detected