pub struct CoolInput<H: CustomInputHandler> {
pub text_data: TextInputData,
pub scroll_x: usize,
pub scroll_y: usize,
pub listening: bool,
pub custom_input: H,
}
Expand description
The main input type. Uses a custom input handler (a struct which implements [CustomInput])
Fields§
§text_data: TextInputData
§scroll_x: usize
§scroll_y: usize
§listening: bool
§custom_input: H
Implementations§
Source§impl<H: CustomInputHandler> CoolInput<H>
impl<H: CustomInputHandler> CoolInput<H>
Sourcepub fn new(handler: H, tab_width: usize) -> Self
pub fn new(handler: H, tab_width: usize) -> Self
Examples found in repository?
More examples
Sourcepub fn get_terminal_size(&mut self) -> Result<(u16, u16), Error>
pub fn get_terminal_size(&mut self) -> Result<(u16, u16), Error>
Get the size of the terminal running the program
Sourcepub fn listen_quiet(&mut self) -> Result<(), Error>
pub fn listen_quiet(&mut self) -> Result<(), Error>
Start listening for key presses without preparing the terminal
Sourcepub fn pre_listen(&mut self) -> Result<(), Error>
pub fn pre_listen(&mut self) -> Result<(), Error>
Prepare the terminal for input
Sourcepub fn post_listen(&mut self) -> Result<(), Error>
pub fn post_listen(&mut self) -> Result<(), Error>
Restore the terminal after input is finished.
Auto Trait Implementations§
impl<H> Freeze for CoolInput<H>where
H: Freeze,
impl<H> RefUnwindSafe for CoolInput<H>where
H: RefUnwindSafe,
impl<H> Send for CoolInput<H>where
H: Send,
impl<H> Sync for CoolInput<H>where
H: Sync,
impl<H> Unpin for CoolInput<H>where
H: Unpin,
impl<H> UnwindSafe for CoolInput<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more