Incular logoIncular
API ReferencePlatform & Testing

Text Input

IME commands, client identity, and headless adapters.

TextInputCommand values queue without native handles: SetClient { configuration, state, caret_rect } / Update / SetCaretRect / Hide / Clear. TextInputClientId(u64) identifies retained-tree clients. TextInputType: Text / Multiline / Number / Phone / Email / Url / Password (soft-keyboard hints).

use incular::prelude::*;

struct MyAdapter {
    seen: usize,
}

impl TextInputAdapter for MyAdapter {
    fn apply(&mut self, _command: &TextInputCommand) {
        self.seen += 1;
    }
}

fn main() {
    let mut adapter = MemoryTextInputAdapter::default();
    adapter.clear();
    println!("recorded: {}", adapter.commands().len());
    let custom = MyAdapter { seen: 0 };
    println!("custom seen: {}", custom.seen);
}

Related: TextEditingController, Desktop.