mirror of
https://github.com/phranck/TUIkit.git
synced 2026-05-21 09:50:35 +00:00
Docs: Replace ASCII diagram with rendered image in KeyboardShortcuts
- Add keyboard-event-dispatch.png (light + dark) rendered from Mermaid - Replace ASCII code block with @Image directive matching existing DocC style
This commit is contained in:
@@ -6,27 +6,7 @@ How keyboard input flows through TUIkit: from raw terminal bytes to your view ha
|
||||
|
||||
TUIkit uses a layered event dispatch system. When a key is pressed, it passes through up to three layers. The first layer that consumes the event wins: remaining layers are skipped.
|
||||
|
||||
```
|
||||
Terminal raw bytes
|
||||
│
|
||||
▼
|
||||
KeyEvent.parse()
|
||||
│
|
||||
▼
|
||||
┌─────────────────────────────┐
|
||||
│ Layer 1: Status Bar Items │ Shortcuts with actions (e.g. "q" quit)
|
||||
└────────────┬────────────────┘
|
||||
│ not consumed
|
||||
▼
|
||||
┌─────────────────────────────┐
|
||||
│ Layer 2: View Handlers │ .onKeyPress() modifiers (deepest view first)
|
||||
└────────────┬────────────────┘
|
||||
│ not consumed
|
||||
▼
|
||||
┌─────────────────────────────┐
|
||||
│ Layer 3: Default Bindings │ q=quit, t=theme, a=appearance
|
||||
└─────────────────────────────┘
|
||||
```
|
||||
@Image(source: "keyboard-event-dispatch.png", alt: "Flowchart showing keyboard event dispatch: Terminal raw bytes are parsed by KeyEvent.parse(), then dispatched through three layers. Layer 1: Status Bar Items (shortcuts with actions). If not consumed, Layer 2: View Handlers (.onKeyPress modifiers, deepest view first). If not consumed, Layer 3: Default Bindings (quit, theme, appearance).")
|
||||
|
||||
Additionally, `Ctrl+C` (SIGINT) is handled at the OS signal level **before** any of these layers: it always terminates the application.
|
||||
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
Reference in New Issue
Block a user