Struct crossterm_winapi::ButtonState[][src]

pub struct ButtonState { /* fields omitted */ }
Expand description

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

Implementations

Get whether no buttons are being pressed.

Returns whether the left button was pressed.

Returns whether the right button was pressed.

Returns whether the right button was pressed.

Returns whether there is a down scroll.

Returns whether there is a up scroll.

Returns the raw state.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.