Crate tui_input

source ·
Expand description

TUI input library supporting multiple backends.

Example: Without any backend

use tui_input::{Input, InputRequest, StateChanged};

let mut input: Input = "Hello Worl".into();

let req = InputRequest::InsertChar('d');
let resp = input.handle(req);

assert_eq!(resp, Some(StateChanged { value: true, cursor: true }));
assert_eq!(input.cursor(), 11);
assert_eq!(input.to_string(), "Hello World");

See other examples in the GitHub repo.

Modules

Structs

Enums

  • Input requests are used to change the input state.

Type Definitions