#[repr(u8)]pub enum MouseButton {
Show 32 variants
Left = 0,
Right = 1,
Middle = 2,
Back = 3,
Forward = 4,
Button6 = 5,
Button7 = 6,
Button8 = 7,
Button9 = 8,
Button10 = 9,
Button11 = 10,
Button12 = 11,
Button13 = 12,
Button14 = 13,
Button15 = 14,
Button16 = 15,
Button17 = 16,
Button18 = 17,
Button19 = 18,
Button20 = 19,
Button21 = 20,
Button22 = 21,
Button23 = 22,
Button24 = 23,
Button25 = 24,
Button26 = 25,
Button27 = 26,
Button28 = 27,
Button29 = 28,
Button30 = 29,
Button31 = 30,
Button32 = 31,
}Expand description
Identifies a button of a mouse controller.
§Platform-specific
The first three buttons should be supported on all platforms.
Self::Back and Self::Forward are supported on most platforms
(when using a compatible mouse).
- Android, iOS: Currently not supported.
- Orbital: Only left/right/middle buttons are supported at this time.
- Web, Windows: Supports left/right/middle/back/forward buttons.
- Wayland: Supports buttons 0..=15.
- macOS: Supports all button variants.
- X11: Technically supports further buttons than this (0..=250), these are emitted in
ButtonSource::Unknown.
Variants§
Left = 0
The primary (usually left) button
Right = 1
The secondary (usually right) button
Middle = 2
The tertiary (usually middle) button
Back = 3
The first side button, frequently assigned a back function
Forward = 4
The second side button, frequently assigned a forward function
Button6 = 5
The sixth button
Button7 = 6
The seventh button
Button8 = 7
The eighth button
Button9 = 8
The ninth button
Button10 = 9
The tenth button
Button11 = 10
The eleventh button
Button12 = 11
The twelfth button
Button13 = 12
The thirteenth button
Button14 = 13
The fourteenth button
Button15 = 14
The fifteenth button
Button16 = 15
The sixteenth button
Button17 = 16
Button18 = 17
Button19 = 18
Button20 = 19
Button21 = 20
Button22 = 21
Button23 = 22
Button24 = 23
Button25 = 24
Button26 = 25
Button27 = 26
Button28 = 27
Button29 = 28
Button30 = 29
Button31 = 30
Button32 = 31
Implementations§
Source§impl MouseButton
impl MouseButton
Sourcepub fn try_from_u8(b: u8) -> Option<MouseButton>
pub fn try_from_u8(b: u8) -> Option<MouseButton>
Construct from a u8 if within the range 0..=31
Trait Implementations§
Source§impl Clone for MouseButton
impl Clone for MouseButton
Source§fn clone(&self) -> MouseButton
fn clone(&self) -> MouseButton
Returns a duplicate 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 MouseButton
impl Debug for MouseButton
Source§impl From<MouseButton> for ButtonSource
impl From<MouseButton> for ButtonSource
Source§fn from(mouse: MouseButton) -> Self
fn from(mouse: MouseButton) -> Self
Converts to this type from the input type.
Source§impl Hash for MouseButton
impl Hash for MouseButton
Source§impl Ord for MouseButton
impl Ord for MouseButton
Source§fn cmp(&self, other: &MouseButton) -> Ordering
fn cmp(&self, other: &MouseButton) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for MouseButton
impl PartialEq for MouseButton
Source§impl PartialOrd for MouseButton
impl PartialOrd for MouseButton
impl Copy for MouseButton
impl Eq for MouseButton
impl StructuralPartialEq for MouseButton
Auto Trait Implementations§
impl Freeze for MouseButton
impl RefUnwindSafe for MouseButton
impl Send for MouseButton
impl Sync for MouseButton
impl Unpin for MouseButton
impl UnwindSafe for MouseButton
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