* Check if this is a printable character with no special modifiers * @param event - KeyboardEvent * @returns true if printable character
(event: KeyboardEvent)
| 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 |