input docs: no backend names in core

This commit is contained in:
Meta Vens 2026-11-28 09:16:04 +01:00
commit bd4df8d000

View file

@ -7,19 +7,19 @@
/// One thing the user did, in the order the host saw it.
#[derive(Clone, Debug, PartialEq)]
pub enum InputEvent {
/// A key press or auto-repeat (`repeat: true`). A release never enters: crossterm reports
/// Release on Windows and the TUI drops it, and the web host drops keyup. `Char` is the
/// A key press or auto-repeat (`repeat: true`). A release never enters: a terminal
/// reports Release on Windows and the TUI drops it, and the web host drops keyup. `Char` is the
/// character the keyboard layout produced (Shift+a is `Char('A')` with `shift` set;
/// Shift+Tab is `Tab` with `shift`). A typing key emits `Key` then `Text`, in that order (DOM
/// keydown precedes beforeinput; winit's KeyEvent carries text beside the key; egui emits
/// keydown precedes beforeinput; a window system's key event carries text beside the key; egui emits
/// Event::Key then Event::Text); a Ctrl or Alt chord emits `Key` only. Commands bind to `Key`.
Key { key: Key, modifiers: Modifiers, repeat: bool },
/// Committed text to insert; a paste is `Text`. Text inserts only from `Text`, so nothing
/// inserts twice.
Text(String),
/// The IME preedit, replacing any earlier one; empty `text` ends it without commit, and the
/// commit arrives as `Text` (winit Ime::Preedit/Commit; DOM compositionupdate/compositionend).
/// `cursor` is UTF-8 byte offsets into `text`, winit's convention; the web host converts the
/// commit arrives as `Text` (DOM compositionupdate/compositionend; a window system's IME preedit and commit).
/// `cursor` is UTF-8 byte offsets into `text`, the window-system convention; the web host converts the
/// DOM's UTF-16 offsets.
Compose { text: String, cursor: Option<(u32, u32)> },
/// `at` is in the space `Placed` is in: logical px, or cells where a terminal cell
@ -33,8 +33,8 @@ pub enum InputEvent {
/// an up outside the canvas still arrives): a pending press is dropped and no up follows.
PointerCancel,
/// `delta` positive y moves content toward its end (the scroll offset grows), positive x
/// right: the DOM WheelEvent sign. crossterm ScrollDown is `(0, 1)` `Lines`; winit's
/// LineDelta has the opposite sign and a winit host negates it. `Units` are logical px or
/// right: the DOM WheelEvent sign. a terminal's ScrollDown is `(0, 1)` `Lines`; a
/// window system whose line delta has the opposite sign is negated by its host. `Units` are logical px or
/// cells; `Lines` are converted by core.
Wheel { at: (f32, f32), delta: (f32, f32), unit: WheelUnit, modifiers: Modifiers },
/// The host window or terminal gained (`true`) or lost focus.