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

Function injectKeyHold

packages/angular-hotkeys/src/injectKeyHold.ts:40–57  ·  view source on GitHub ↗
(
  key: IndividualKey | (() => IndividualKey),
)

Source from the content-addressed store, hash-verified

38 * ```
39 */
40export function injectKeyHold(
41 key: IndividualKey | (() => IndividualKey),
42): Signal<boolean> {
43 const tracker = getKeyStateTracker()
44 const heldKeysSelector = injectSelector(
45 tracker.store,
46 (state) => state.heldKeys,
47 )
48
49 return computed(() => {
50 const resolvedKey = typeof key === 'function' ? key() : key
51 const normalizedKey = resolvedKey.toLowerCase()
52
53 return heldKeysSelector().some(
54 (heldKey) => heldKey.toLowerCase() === normalizedKey,
55 )
56 })
57}

Callers 1

AppComponentClass · 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…