[][src]Enum termimad::Event

pub enum Event {
    Key(KeyEvent),
    Click(u16u16KeyModifiers),
    RightClick(u16u16KeyModifiers),
    DoubleClick(u16u16),
    Resize(u16u16),
    Wheel(i32),
}

a valid user event

Variants

Click(u16u16KeyModifiers)
RightClick(u16u16KeyModifiers)
DoubleClick(u16u16)
Resize(u16u16)

terminal was resized. Contains the new dimensions

Wheel(i32)

mouse wheel turns. contains -1 if up or 1 if down

Implementations

impl Event[src]

pub fn from_crossterm_event(crossterm_event: Result<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 Clone for Event[src]

impl Copy for Event[src]

impl Debug for Event[src]

impl Eq for Event[src]

impl PartialEq<Event> for Event[src]

impl StructuralEq for Event[src]

impl StructuralPartialEq for Event[src]

Auto Trait Implementations

impl RefUnwindSafe for Event

impl Send for Event

impl Sync for Event

impl Unpin for Event

impl UnwindSafe for Event

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.