[][src]Struct crossterm_winapi::ButtonState

pub struct ButtonState { /* fields omitted */ }

The status of the mouse buttons. The least significant bit corresponds to the leftmost mouse button. The next least significant bit corresponds to the rightmost mouse button. The next bit indicates the next-to-leftmost mouse button. The bits then correspond left to right to the mouse buttons. A bit is 1 if the button was pressed.

The state can be one of the following: Release = 0x0000, // The leftmost mouse button. FromLeft1stButtonPressed = 0x0001, // The second button from the left. FromLeft2ndButtonPressed = 0x0004, // The third button from the left. FromLeft3rdButtonPressed = 0x0008, // The fourth button from the left. FromLeft4thButtonPressed = 0x0010, // The rightmost mouse button. RightmostButtonPressed = 0x0002, // This button state is not recognized. Unknown = 0x0021, // The wheel was rotated backward, toward the user; this will only be activated for MOUSE_WHEELED from dwEventFlags Negative = 0x0020,

Ms Docs

Methods

impl ButtonState[src]

pub fn release_button(&self) -> bool[src]

pub fn left_button(&self) -> bool[src]

Returns whether the left button was pressed.

pub fn right_button(&self) -> bool[src]

Returns whether the right button was pressed.

pub fn middle_button(&self) -> bool[src]

Returns whether the right button was pressed.

pub fn scroll_down(&self) -> bool[src]

Returns whether there is a down scroll.

pub fn scroll_up(&self) -> bool[src]

Returns whether there is a up scroll.

pub fn state(&self) -> i32[src]

Returns the raw state.

Trait Implementations

impl From<u32> for ButtonState[src]

impl Clone for ButtonState[src]

impl Copy for ButtonState[src]

impl PartialEq<ButtonState> for ButtonState[src]

impl PartialOrd<ButtonState> for ButtonState[src]

impl Debug for ButtonState[src]

impl StructuralPartialEq for ButtonState[src]

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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