pub struct TextInputState {
pub text: String,
pub cursor: usize,
pub selection_start: Option<usize>,
pub cursor_visible: bool,
pub scroll_offset: f32,
/* private fields */
}Expand description
State for a text input widget.
Fields§
§text: StringCurrent text content.
cursor: usizeCursor position (character index).
selection_start: Option<usize>Selection start (None = no selection).
cursor_visible: boolWhether the cursor blink is visible.
scroll_offset: f32Scroll offset for long text.
Implementations§
Source§impl TextInputState
impl TextInputState
Sourcepub fn handle_text_input(&mut self, input_text: &str)
pub fn handle_text_input(&mut self, input_text: &str)
Handle text input events (called when focused).
Sourcepub fn handle_key(&mut self, key: KeyCode, modifiers: KeyModifiers)
pub fn handle_key(&mut self, key: KeyCode, modifiers: KeyModifiers)
Handle a key press event.
Trait Implementations§
Source§impl Clone for TextInputState
impl Clone for TextInputState
Source§fn clone(&self) -> TextInputState
fn clone(&self) -> TextInputState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TextInputState
impl Debug for TextInputState
Auto Trait Implementations§
impl Freeze for TextInputState
impl RefUnwindSafe for TextInputState
impl Send for TextInputState
impl Sync for TextInputState
impl Unpin for TextInputState
impl UnsafeUnpin for TextInputState
impl UnwindSafe for TextInputState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more