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

Method isPrintableCharacter

lib/input-handler.ts:285–294  ·  view source on GitHub ↗

* Check if this is a printable character with no special modifiers * @param event - KeyboardEvent * @returns true if printable character

(event: KeyboardEvent)

Source from the content-addressed store, hash-verified

283 * @returns true if printable character
284 */
285 private isPrintableCharacter(event: KeyboardEvent): boolean {
286 // If Ctrl, Alt, or Meta (Cmd on Mac) is pressed, it's not a simple printable character
287 // Exception: AltGr (Ctrl+Alt on some keyboards) can produce printable characters
288 if (event.ctrlKey && !event.altKey) return false;
289 if (event.altKey && !event.ctrlKey) return false;
290 if (event.metaKey) return false; // Cmd key on Mac
291
292 // If key produces a single printable character
293 return event.key.length === 1;
294 }
295
296 /**
297 * Handle keydown event

Callers 1

handleKeyDownMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected