MCPcopy Index your code
hub / github.com/codeaashu/claude-code / modifiersMatch

Function modifiersMatch

src/keybindings/match.ts:60–79  ·  view source on GitHub ↗

* Check if all modifiers match between Ink Key and ParsedKeystroke. * * Alt and Meta: Ink historically set `key.meta` for Alt/Option. A `meta` * modifier in config is treated as an alias for `alt` — both match when * `key.meta` is true. * * Super (Cmd/Win): distinct from alt/meta. Only arrives

(
  inkMods: InkModifiers,
  target: ParsedKeystroke,
)

Source from the content-addressed store, hash-verified

58 * simply never fire on terminals that don't send it.
59 */
60function modifiersMatch(
61 inkMods: InkModifiers,
62 target: ParsedKeystroke,
63): boolean {
64 // Check ctrl modifier
65 if (inkMods.ctrl !== target.ctrl) return false
66
67 // Check shift modifier
68 if (inkMods.shift !== target.shift) return false
69
70 // Alt and meta both map to key.meta in Ink (terminal limitation)
71 // So we check if EITHER alt OR meta is required in target
72 const targetNeedsMeta = target.alt || target.meta
73 if (inkMods.meta !== targetNeedsMeta) return false
74
75 // Super (cmd/win) is a distinct modifier from alt/meta
76 if (inkMods.super !== target.super) return false
77
78 return true
79}
80
81/**
82 * Check if a ParsedKeystroke matches the given Ink input + Key.

Callers 1

matchesKeystrokeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected