pub enum MouseButton {
Primary,
Secondary,
Auxiliary,
Fourth,
Fifth,
Unknown,
}
Expand description
A mouse button type (such as Primary/Secondary)
Variants§
Primary
Primary button (typically the left button)
Secondary
Secondary button (typically the right button)
Auxiliary
Auxiliary button (typically the middle button)
Fourth
Fourth button (typically the “Browser Back” button)
Fifth
Fifth button (typically the “Browser Forward” button)
Unknown
A button with an unknown code
Implementations§
Source§impl MouseButton
impl MouseButton
Sourcepub fn from_web_code(code: i16) -> MouseButton
pub fn from_web_code(code: i16) -> MouseButton
Constructs a MouseButton for the specified button code
E.g. 0 => Primary; 1 => Auxiliary
Unknown codes get mapped to MouseButton::Unknown.
Sourcepub fn into_web_code(self) -> i16
pub fn into_web_code(self) -> i16
Converts MouseButton into the corresponding button code
MouseButton::Unknown will get mapped to -1
Trait Implementations§
Source§impl<O> BitAnd<O> for MouseButton
impl<O> BitAnd<O> for MouseButton
Source§impl<O> BitOr<O> for MouseButton
impl<O> BitOr<O> for MouseButton
Source§impl<O> BitXor<O> for MouseButton
impl<O> BitXor<O> for MouseButton
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 Default for MouseButton
impl Default for MouseButton
Source§fn default() -> MouseButton
fn default() -> MouseButton
Returns the “default value” for a type. Read more
Source§impl Not for MouseButton
impl Not for MouseButton
Source§impl PartialEq<EnumSet<MouseButton>> for MouseButton
impl PartialEq<EnumSet<MouseButton>> for MouseButton
Source§impl PartialEq for MouseButton
impl PartialEq for MouseButton
Source§impl<O> Sub<O> for MouseButton
impl<O> Sub<O> for MouseButton
impl Copy for MouseButton
impl EnumSetType for MouseButton
impl Eq 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,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<Ret> SpawnIfAsync<(), Ret> for Ret
impl<Ret> SpawnIfAsync<(), Ret> for Ret
Source§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
Source§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
Source§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
Source§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.