MCPcopy Create free account
hub / github.com/TanStack/hotkeys / useKeyHold

Function useKeyHold

packages/preact-hotkeys/src/useKeyHold.ts:45–52  ·  view source on GitHub ↗
(key: IndividualKey)

Source from the content-addressed store, hash-verified

43 * ```
44 */
45export function useKeyHold(key: IndividualKey): boolean {
46 const tracker = getKeyStateTracker()
47 const normalizedKey = key.toLowerCase()
48
49 return useSelector(tracker.store, (state) =>
50 state.heldKeys.some((heldKey) => heldKey.toLowerCase() === normalizedKey),
51 )
52}

Callers 1

AppFunction · 0.90

Calls 1

getKeyStateTrackerFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…