Module text_input

Module text_input 

Source
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§

TextInput
Text input widget.
TextInputState
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.