MCPcopy Index your code
hub / github.com/triggerdotdev/jsonhero-web / KeyboardShortcuts

Function KeyboardShortcuts

app/components/JsonColumnView.tsx:22–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22function KeyboardShortcuts() {
23 const api = useJsonColumnViewAPI();
24
25 useHotkeys(
26 "down",
27 (e) => {
28 e.preventDefault();
29 api.goToNextSibling();
30 },
31 { enabled: true },
32 [api]
33 );
34
35 useHotkeys(
36 "up",
37 (e) => {
38 e.preventDefault();
39 api.goToPreviousSibling();
40 },
41 [api]
42 );
43
44 useHotkeys(
45 "right",
46 (e) => {
47 e.preventDefault();
48 api.goToChildren();
49 },
50 [api]
51 );
52
53 useHotkeys(
54 "left,alt+left",
55 (e) => {
56 e.preventDefault();
57 api.goToParent({ source: e });
58 },
59 [api]
60 );
61
62 useHotkeys(
63 "esc",
64 (e) => {
65 e.preventDefault();
66 api.resetSelection();
67 },
68 [api]
69 );
70
71 return <>
72 <CopySelectedNodeShortcut />
73 </>;
74}

Callers

nothing calls this directly

Calls 1

useJsonColumnViewAPIFunction · 0.90

Tested by

no test coverage detected