Enum MouseButton
#[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§
§impl MouseButton
impl MouseButton
pub 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§
§impl Clone for MouseButton
impl Clone for MouseButton
§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 more§impl Debug for MouseButton
impl Debug for MouseButton
§impl From<MouseButton> for ButtonSource
impl From<MouseButton> for ButtonSource
§fn from(mouse: MouseButton) -> ButtonSource
fn from(mouse: MouseButton) -> ButtonSource
Converts to this type from the input type.
§impl Hash for MouseButton
impl Hash for MouseButton
§impl Ord for MouseButton
impl Ord for MouseButton
§impl PartialEq for MouseButton
impl PartialEq for MouseButton
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.