Struct termimad::InputField [−][src]
Expand description
A simple input field, managing its cursor position and either handling the events you give it or being managed through direct manipulation functions (put_char, del_char_left, etc.)
Fields
area: Area
focused: bool
Implementations
tell whether the content of the input is equal to the argument
change the content to the new one and put the cursor at the end if the content is different from the previous one.
put a char at cursor position (and increment this position)
remove the char left of the cursor, if any
remove the char at cursor position, if any
delete the word rigth of the cursor.
apply an event being a key without modifier.
You don’t usually call this function but the more
general apply_event
. This one is useful when you
manage events mostly yourselves.
This function handles a few events like deleting a
char, or going to the start (home key) or end (end key)
of the input. If you want to totally handle events, you
may call function like put_char
and del_char_left
directly.
apply a click event
(for when you handle the events yourselves and don’t have a termimad event)
apply the passed event to change the state (content, cursor)
Return true when the event was used.
render the input field on screen.
All rendering must be explicitely called, no rendering is done on functions changing the state.
w is typically either stderr or stdout.
Auto Trait Implementations
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin for InputField
impl UnwindSafe for InputField