MCPcopy
hub / github.com/jamiebuilds/tinykeys / getModifierState

Function getModifierState

src/tinykeys.ts:151–156  ·  view source on GitHub ↗

* There's a bug in Chrome that causes event.getModifierState not to exist on * KeyboardEvent's for F1/F2/etc keys.

(event: KeyboardEvent, mod: string)

Source from the content-addressed store, hash-verified

149 * KeyboardEvent's for F1/F2/etc keys.
150 */
151function getModifierState(event: KeyboardEvent, mod: string) {
152 return typeof event.getModifierState === "function"
153 ? event.getModifierState(mod) ||
154 (ALT_GRAPH_ALIASES.includes(mod) && event.getModifierState("AltGraph"))
155 : false
156}
157
158/**
159 * Parses a keybinding string into its parts.

Callers 2

matchKeybindingPressFunction · 0.85
createKeybindingsHandlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…