Expand description
Input components for text editing in GPUI applications.
This module provides the state management and keybinding infrastructure for building text input components. It includes:
InputState: The core state model for text input, handling content, selection, cursor management, and edit history.CursorBlink: Manages cursor blinking state for input components.InputBindings: Configurable keybindings for input actions.TextDirection: Bidirectional text support for RTL/LTR detection.
§Example
use gpuikit::input::{InputState, bind_input_keys};
// Initialize keybindings (typically in app initialization)
bind_input_keys(cx, None);
// Create an input state
let input = cx.new(|cx| InputState::new_singleline(cx));Re-exports§
pub use bindings::INPUT_CONTEXT;pub use bindings::InputBindings;pub use bindings::bind_input_keys;
Modules§
- bindings
- Input keybinding configuration & actions that can be bound (
Backspace,Copy, etc.).
Structs§
- Cursor
Blink - Manages the blinking state of a text cursor.
- Element
Input Handler - The canonical implementation of
gpui::PlatformInputHandler. CallWindow::handle_inputwith an instance during your element’s paint. - Input
Line Layout - Layout information for a single logical line of text in an input.
- Input
State Inputis the state model for text input components. It handles:
Enums§
- Input
State Event - Events emitted by InputState when significant changes occur.
- Submit
On - Which keystroke fires
InputStateEvent::Submit. - Text
Direction - Text direction for bidirectional text support.
Traits§
- Entity
Input Handler - Implement this trait to allow views to handle textual input when implementing an editor, field, etc.
Functions§
- detect_
base_ direction - Detects the base direction of text using the first strong directional character.