MCPcopy Create free account
hub / github.com/coder/ghostty-web / extractModifiers

Method extractModifiers

lib/input-handler.ts:265–278  ·  view source on GitHub ↗

* Extract modifier flags from KeyboardEvent * @param event - KeyboardEvent * @returns Mods flags

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

263 * @returns Mods flags
264 */
265 private extractModifiers(event: KeyboardEvent): Mods {
266 let mods = Mods.NONE;
267
268 if (event.shiftKey) mods |= Mods.SHIFT;
269 if (event.ctrlKey) mods |= Mods.CTRL;
270 if (event.altKey) mods |= Mods.ALT;
271 if (event.metaKey) mods |= Mods.SUPER;
272
273 // Note: CapsLock and NumLock are not in KeyboardEvent modifiers
274 // They would need to be tracked separately if needed
275 // For now, we don't set CAPSLOCK or NUMLOCK flags
276
277 return mods;
278 }
279
280 /**
281 * Check if this is a printable character with no special modifiers

Callers 1

handleKeyDownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected