Struct crossterm_winapi::ButtonState 
source · pub struct ButtonState { /* private fields */ }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,Implementations§
source§impl ButtonState
 
impl ButtonState
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.
sourcepub fn scroll_down(&self) -> bool
 
pub fn scroll_down(&self) -> bool
Returns whether there is a down scroll.
sourcepub fn scroll_right(&self) -> bool
 
pub fn scroll_right(&self) -> bool
Returns whether there is a horizontal scroll to the right.
sourcepub fn scroll_left(&self) -> bool
 
pub fn scroll_left(&self) -> bool
Returns whether there is a horizontal scroll to the left.
Trait Implementations§
source§impl Clone for ButtonState
 
impl Clone for ButtonState
source§fn clone(&self) -> ButtonState
 
fn clone(&self) -> ButtonState
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from 
source. Read moresource§impl Debug for ButtonState
 
impl Debug for ButtonState
source§impl From<u32> for ButtonState
 
impl From<u32> for ButtonState
source§impl PartialEq<ButtonState> for ButtonState
 
impl PartialEq<ButtonState> for ButtonState
source§fn eq(&self, other: &ButtonState) -> bool
 
fn eq(&self, other: &ButtonState) -> bool
This method tests for 
self and other values to be equal, and is used
by ==.