MCPcopy Create free account
hub / github.com/akarlsten/cuberun / KeyboardControls

Function KeyboardControls

src/components/KeyboardControls.js:32–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30}
31
32export default function KeyboardControls() {
33 const set = useStore((state) => state.set)
34 useKeys(['ArrowLeft', 'a', 'A'], (left) => set((state) => ({ ...state, controls: { ...state.controls, left } })))
35 useKeys(['ArrowRight', 'd', 'D'], (right) => set((state) => ({ ...state, controls: { ...state.controls, right } })))
36
37 return null
38}

Callers

nothing calls this directly

Calls 1

useKeysFunction · 0.85

Tested by

no test coverage detected