Skip to content

Commit

Permalink
add hot key for toggling grid
Browse files Browse the repository at this point in the history
  • Loading branch information
sashankaryal committed Mar 27, 2024
1 parent d648c2c commit 40ce1d5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion app/packages/looker-3d/src/Looker3d.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ActionBar } from "./action-bar";
import { Container } from "./containers";
import { MediaTypeFo3dComponent } from "./fo3d/MediaTypeFo3d";
import { useHotkey } from "./hooks";
import { currentActionAtom } from "./state";
import { currentActionAtom, isGridOnAtom } from "./state";

/**
* This component is responsible for rendering both "3d" as well as "point_cloud" media types.
Expand Down Expand Up @@ -44,6 +44,14 @@ export const Looker3d = () => {

const sampleMap = useRecoilValue(fos.activePcdSlicesToSampleMap);

useHotkey(
"KeyG",
async ({ set }) => {
set(isGridOnAtom, (prev) => !prev);
},
[]
);

useHotkey(
"Escape",
async ({ snapshot, set }) => {
Expand Down

0 comments on commit 40ce1d5

Please sign in to comment.