MCPcopy Create free account
hub / github.com/enowdev/enowX-Coder / handleKeyDown

Function handleKeyDown

src/App.tsx:25–38  ·  view source on GitHub ↗
(e: KeyboardEvent)

Source from the content-addressed store, hash-verified

23
24 useEffect(() => {
25 const handleKeyDown = (e: KeyboardEvent) => {
26 if ((e.metaKey || e.ctrlKey) && e.key === 'n') {
27 e.preventDefault();
28 const session = {
29 id: generateId(),
30 projectId: activeProjectId ?? 'default',
31 title: 'New Chat',
32 createdAt: new Date().toISOString(),
33 updatedAt: new Date().toISOString(),
34 };
35 addSession(session);
36 setActiveSessionId(session.id);
37 }
38 };
39
40 window.addEventListener('keydown', handleKeyDown);
41 return () => window.removeEventListener('keydown', handleKeyDown);

Callers

nothing calls this directly

Calls 1

generateIdFunction · 0.90

Tested by

no test coverage detected