pub enum Button {
Left,
Right,
Middle,
X1,
X2,
Extra3,
Extra4,
Extra5,
Extra6,
Extra7,
Extra8,
}Expand description
Mouse button enumeration
Variants§
Left
Left mouse button
Right
Right mouse button
Middle
Middle mouse button (scroll wheel press)
X1
X1 button (usually back)
X2
X2 button (usually forward)
Extra3
Extra button 3
Extra4
Extra button 4
Extra5
Extra button 5
Extra6
Extra button 6
Extra7
Extra button 7
Extra8
Extra button 8
Implementations§
Source§impl Button
impl Button
Sourcepub fn to_code(&self, platform: Platform) -> usize
pub fn to_code(&self, platform: Platform) -> usize
Convert the button to a platform-specific code
Sourcepub fn from_code(code: usize, platform: Platform) -> Option<Self>
pub fn from_code(code: usize, platform: Platform) -> Option<Self>
Parse a button from a platform-specific code
Sourcepub fn to_current_platform_code(&self) -> usize
pub fn to_current_platform_code(&self) -> usize
Get the code for this button on the current platform
Sourcepub fn from_current_platform_code(code: usize) -> Option<Self>
pub fn from_current_platform_code(code: usize) -> Option<Self>
Parse a button from a code on the current platform
Sourcepub fn matches_code(&self, code: usize, platform: Platform) -> bool
pub fn matches_code(&self, code: usize, platform: Platform) -> bool
Check if this button matches the given code on the specified platform
Sourcepub fn matches_current_platform_code(&self, code: usize) -> bool
pub fn matches_current_platform_code(&self, code: usize) -> bool
Check if this button matches the given code on the current platform
Trait Implementations§
Source§impl CodeMapper for Button
impl CodeMapper for Button
Source§impl CodeMapperImpl for Button
impl CodeMapperImpl for Button
impl Copy for Button
impl Eq for Button
impl StructuralPartialEq for Button
Auto Trait Implementations§
impl Freeze for Button
impl RefUnwindSafe for Button
impl Send for Button
impl Sync for Button
impl Unpin for Button
impl UnwindSafe for Button
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more