Enum termimad::Event [−][src]
pub enum Event { Key(KeyEvent), Click(u16, u16, KeyModifiers), RightClick(u16, u16, KeyModifiers), DoubleClick(u16, u16), Resize(u16, u16), Wheel(i32), }
a valid user event
Variants
Key(KeyEvent)
Click(u16, u16, KeyModifiers)
RightClick(u16, u16, KeyModifiers)
terminal was resized. Contains the new dimensions
Wheel(i32)
mouse wheel turns. contains -1 if up or 1 if down
Implementations
impl Event
[src]
impl Event
[src]pub fn from_crossterm_event(crossterm_event: Event) -> Option<Event>
[src]
convert a crossterm event into a termimad one.
normalize \r and \n into Enter (useful for key combinations)
To get a double-click you’ll either need to use a termimad event-source or to do the computation yourself.
pub const fn crtl_key(code: KeyCode) -> Self
[src]
pub const fn simple_key(code: KeyCode) -> Self
[src]
pub fn mouse_pos(self) -> Option<(u16, u16)>
[src]
In case the event is mouse related, give the position
Trait Implementations
impl StructuralEq for Event
[src]
impl StructuralEq for Event
[src]impl StructuralPartialEq for Event
[src]
impl StructuralPartialEq for Event
[src]Auto Trait Implementations
impl RefUnwindSafe for Event
impl RefUnwindSafe for Event
impl UnwindSafe for Event
impl UnwindSafe for Event