Expand description
Text input widget.
- Can do the usual insert/delete/movement operations.
- Text selection via keyboard and mouse.
- Scrolls with the cursor.
- Invalid flag.
The visual cursor must be set separately after rendering. It is accessible as TextInputState::screen_cursor() after rendering.
Event handling by calling the freestanding fn handle_events. There’s handle_mouse_events if you want to override the default key bindings but keep the mouse behaviour.
Structs§
- Text
Input - Text input widget.
- Text
Input State - State for TextInput.
Functions§
- handle_
events - Handle all events. Text events are only processed if focus is true. Mouse events are processed if they are in range.
- handle_
mouse_ events - Handle only mouse-events.
- handle_
readonly_ events - Handle only navigation events. Text events are only processed if focus is true. Mouse events are processed if they are in range.