pub enum TextEditRequest {
Show 14 variants
Insert {
entity: Entity,
at: TextPos,
text: Arc<str>,
},
Delete {
entity: Entity,
range: Range<usize>,
},
Replace {
entity: Entity,
range: Range<usize>,
text: Arc<str>,
},
MoveCursor {
entity: Entity,
motion: CursorMotion,
mode: MoveMode,
},
Select {
entity: Entity,
range: Range<usize>,
},
SetCursor {
entity: Entity,
pos: TextPos,
},
ExtendSelection {
entity: Entity,
pos: TextPos,
},
SelectAll {
entity: Entity,
},
Undo {
entity: Entity,
},
Redo {
entity: Entity,
},
ImeBegin {
entity: Entity,
},
ImeUpdate {
entity: Entity,
text: Arc<str>,
caret_in_preedit: usize,
},
ImeCommit {
entity: Entity,
text: Arc<str>,
replace_range: Option<Range<usize>>,
},
ImeCancel {
entity: Entity,
},
}Expand description
One text-editing request addressed to entity’s crate::text_model::TextBuffer.
Producers write into a bevy_ecs::message::Messages queue; the
single [lumen_text_edit::text_apply_edits] system drains them.
Variants§
Insert
Insert text at at.
Fields
Delete
Delete the byte range.
Replace
Replace range with text (IME’s replacementStart/Length).
Fields
MoveCursor
Move the cursor.
Fields
motion: CursorMotionMotion axis.
Select
Set selection range (in bytes).
SetCursor
Set cursor to an explicit position (collapses selection).
ExtendSelection
Move the selection head to pos while keeping the current anchor
(Shift+click, pointer drag). Unlike Self::Select the anchor
side is preserved, so repeated extends pivot around the same
fixed end regardless of direction.
SelectAll
Select all.
Undo
Pop one entry off the undo stack.
Redo
Re-apply the next redo entry.
ImeBegin
Begin an IME composition (no-op if already active).
ImeUpdate
Update the IME preedit.
Fields
ImeCommit
Commit the IME preedit; replaces replace_range with text if
replace_range is Some, otherwise inserts text at the cursor.
Fields
ImeCancel
Cancel any active IME preedit without committing.
Implementations§
Trait Implementations§
Source§impl Clone for TextEditRequest
impl Clone for TextEditRequest
Source§fn clone(&self) -> TextEditRequest
fn clone(&self) -> TextEditRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more