MCPcopy Create free account
hub / github.com/IIIIQIIII/claude-code / isModifierPressed

Function isModifierPressed

src/utils/modifiers.ts:27–41  ·  view source on GitHub ↗
(modifier: ModifierKey)

Source from the content-addressed store, hash-verified

25 * Check if a specific modifier key is currently pressed (synchronous).
26 */
27export function isModifierPressed(modifier: ModifierKey): boolean {
28 if (process.platform !== 'darwin') {
29 return false
30 }
31 try {
32 // Dynamic import to avoid loading native module at top level
33 const { isModifierPressed: nativeIsModifierPressed } =
34 // eslint-disable-next-line @typescript-eslint/no-require-imports
35 require('modifiers-napi') as { isModifierPressed: (m: string) => boolean }
36 return nativeIsModifierPressed(modifier)
37 } catch {
38 // Native module not available (e.g. not installed or incompatible runtime)
39 return false
40 }
41}

Callers 1

handleEnterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected