Enum bear_lib_terminal::terminal::Event [] [src]

pub enum Event {
    Close,
    Resize {
        width: i32,
        height: i32,
    },
    MouseMove {
        x: i32,
        y: i32,
    },
    MouseScroll {
        delta: i32,
    },
    KeyPressed {
        key: KeyCode,
        ctrl: bool,
        shift: bool,
    },
    KeyReleased {
        key: KeyCode,
        ctrl: bool,
        shift: bool,
    },
    ShiftPressed,
    ShiftReleased,
    ControlPressed,
    ControlReleased,
}

A single input event.

Variants

Terminal window closed.

Terminal window resized. Needs to have window.resizeable = true to occur.

Note, that, as of 40e6253, the terminal window is cleared when resized.

Fields of Resize

Width the terminal was resized to.

Heigth the terminal was resized to.

Mouse moved.

If precise-mouse is off, generated each time mouse moves from cell to cell, otherwise, when it moves from pixel to pixel.

Fields of MouseMove

0-based cell index from the left to which the mouse cursor moved.

0-based cell index from the top to which the mouse cursor moved.

Mouse wheel moved.

Fields of MouseScroll

Amount of steps the wheel rotated.

Positive when scrolled "down"/"backwards".

Negative when scrolled "up"/"forwards"/"away".

A keyboard or mouse button pressed (might repeat, if set in OS).

Fields of KeyPressed

The key pressed.

Whether the Control key is pressed.

Whether the Shift key is pressed.

A keyboard or mouse button released.

Fields of KeyReleased

The key released.

Whether the Control key is pressed.

Whether the Shift key is pressed.

The Shift key pressed (might repeat, if set in OS).

The Shift key released.

The Shift key pressed (might repeat, if set in OS).

The Control key released.

Trait Implementations

impl Clone for Event
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Event
[src]

impl Debug for Event
[src]

Formats the value using the given formatter.

impl Eq for Event
[src]

impl Hash for Event
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl PartialEq for Event
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.