Decides when printable KeyEvents should be deferred to ImeSession /
TextInputClient instead of encodeKey.
Alacritty reference (alacritty/src/event.rs + input/keyboard.rs):
winit delivers IME on a separate WindowEvent::Ime channel (Preedit/Commit);
key_input is a no-op while display.ime.preedit() is active. Flutter has
no parallel channel — we use TextInputClient plus this routing table.
Composing suppression lives in TerminalView._onKeyFallback (all keys).
Platform split is intentional:
- Linux (fcitx/IBus): while IME is attached in English mode, GTK still
delivers ASCII via hardware keys — defer only during an active composing
range so
encodeKeykeeps working. - macOS / Windows: the OS IME often emits hardware keys before
updateEditingValueestablishes a composing range — defer all uncomposed printables while attached so pinyin/CJK reaches TextInput (with FocusNode.consumeKeyboardToken in TerminalView).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
terminalKeys
→ Set<
LogicalKeyboardKey> -
Keys that must always reach encodeKey, never be deferred to TextInput.
final
Static Methods
-
deferUncomposedPrintableOn(
TargetPlatform platform) → bool - Whether printable keys should be deferred before the platform reports an active composing range. Override via setDeferUncomposedPrintableOverride for tests or future host-specific policy.
-
isDeferrablePrintableKeyEvent(
KeyEvent event, HardwareKeyboard hw) → bool -
True when this KeyEvent is a text character IME should own (not
Backspace/DEL/C0 controls — macOS may set
characteron those). -
setDeferUncomposedPrintableOverride(
bool override(TargetPlatform platform)?) → void -
shouldDeferPrintableToTextInput(
{required bool imeAttached, required bool imeComposing, TargetPlatform? platform}) → bool - Returns true when a printable key with no Ctrl/Alt/Meta should return KeyEventResult.ignored from the terminal focus handler.