* Add key text, consumed modifiers and native key info to key events
KeyEventArgs gets the data that terminal emulators need to encode keys:
- KeyText: the text that the platform layout produced with all modifiers
applied, including C0 control characters.
- KeyTextIgnoringModifiers: the text with Shift, Caps Lock and AltGr applied
and Ctrl, Alt and Meta ignored (Option on macOS).
- ConsumedModifiers: the pressed modifiers that the layout used, with the
xkbcommon GTK rules on X11 and Wayland, a per-layout key table on Win32 and
UCKeyTranslate comparisons on macOS.
- NativeKeyInfo: the platform scan code, virtual key and modifier state.
Win32 pairs WM_CHAR/WM_SYSCHAR with their key down, marks keys that use a
pending dead key as DeadCharProcessed, and makes at most one ToUnicodeEx call
per key event. Wayland key repeat resolves the key again on every repeat, so
it types text and follows modifier changes.
ControlCatalog gets a Terminal page with a TERM=ansi-mini terminal on a PTY
(posix_spawn on Linux and macOS, ConPTY on Windows) and a key inspector.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rename NativeKeyInfo to PlatformKeyInfo and use a string format catalog
Replace the NativeKeyInfoFormat enum with KnownPlatformKeyInfoFormats, a static
class of string values, like the GPU interop handle types. Format is a
constructor parameter of PlatformKeyInfo.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Make KnownPlatformKeyInfoFormats values constants
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Replace the ControlCatalog terminal demo with a key events table
The Key Events page lists KeyDown and TextInput events with their key text,
consumed modifiers and platform scan code and virtual key. A Terminal column
shows what a terminal emulator sends for each key, in caret notation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Address review feedback on Win32 dead keys, PlatformKeyInfo and layout tables
- PlatformKeyInfo is a readonly record struct.
- Any key that produces text ends a pending dead key, except Ctrl/Alt chords
that produce only control characters, so Enter no longer leaves the next
key marked as DeadCharProcessed.
- A dead key pressed twice reports the dead char as KeyTextIgnoringModifiers.
- The dead-key state is shared by all windows and processes, so a window ends
any pending dead key when it gains focus, instead of resetting its flag on
focus loss.
- Shared helpers for control-character checks.
- Layout tables end a pending dead key before they are built, and are built
with Task.Run.
- Remove the unused VkKeyScanExW import.
- Win32 integration tests that send keyboard input, including Alt+Numpad
with a focus change while Alt is pressed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rename KeyTextIgnoringModifiers to AlternateKeyText
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Julien Lebosquain <julien@lebosquain.net>