GuestKeyboard class
Delivers the guest's key events, which the framework otherwise parks forever.
Without this no key reaches a demo at all — not a shortcut, not an
arrow, not a character. The reason is a handshake our embedder cannot take
part in. KeyEventManager.handleKeyData receives what
FlutterEngineSendKeyEvent sends, infers from that first event that it is
talking to a keyDataThenRawKeyData embedder, and then queues every
event instead of dispatching it — because a platform embedder always
follows its key data with a legacy flutter/keyevent platform message,
and that message is what flushes the queue. The guest's host is a few
hundred lines of C with no platform channels, so the flush never comes and
the queue only grows.
Rather than have the C host fake a macOS raw-key JSON message — feeding a
path the framework has deprecated, in a keymap-specific format, to reach a
RawKeyboard whose state would then have to be kept consistent — this
replaces onKeyData and dispatches to both destinations the flush would
have reached: HardwareKeyboard, which owns the pressed-key state and the
handler list, and keyMessageHandler, which is where FocusManager sits
and therefore how Focus.onKeyEvent, Shortcuts and a text field's own
editing keys are reached.
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
-
install(
) → void -
Takes over key delivery. Call after the binding exists — it is
ServicesBindingthat installs the handler being replaced — and beforerunApp. -
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
- instance → GuestKeyboard
-
final