gpui: Add character input preference to keystroke events (#64859)
Adds `KeystrokeEvent::character_input_preferred` so keystroke
interceptors can follow the same text-over-bindings policy as normal
dispatch, which #64803 needs. The field is true when the platform
prefers character input for the key and the focused input handler
accepts text.
For example, with the Polish (Programmers) layout on Windows, AltGr+A
types `ą` but arrives as `ctrl-alt-a`. Normal dispatch already skips the
matching binding when the editor accepts text. Interceptors now get that
information too. It's only a hint: an interceptor can still stop
propagation to take the keystroke instead of letting it type text, e.g.
when recording a keybinding.
The preference is computed before interception, then computed again
right before binding dispatch, because whether the editor accepts text
can change in between:
- An interceptor may turn text input on or off and still let the
keystroke through.
- A pending keystroke that gets replayed may run an action that turns
text input on.
Release Notes:
- N/A
- [GPUI] Added `KeystrokeEvent::character_input_preferred` so keystroke
interceptors can respect text input priority.
86c20cc911Smit Barmase committed on 9/28/2026, 11:18:28 AM· committed by GitHubparent20e3812