Skip to main content

rab/tui/
focusable.rs

1use crate::tui::Component;
2
3/// Components that display a text cursor and need IME support.
4pub trait Focusable: Component {
5    fn set_focused(&mut self, focused: bool);
6    fn focused(&self) -> bool;
7}
8
9/// Zero-width APC sequence marking cursor position for IME.
10/// Components emit this at the cursor position when focused.
11/// The Screen finds and strips this marker, then positions the hardware cursor there.
12pub const CURSOR_MARKER: &str = "\x1b_pi:c\x07";