pub enum Mouse {
LeftButton,
MiddleButton,
RightButton,
X1Button,
X2Button,
OtherButton(u32),
}
Variants§
Implementations§
§impl MouseButton
impl MouseButton
pub fn bind<F>(self, callback: F)where F: Fn() + Send + Sync + 'static,
pub fn block_bind<F>(self, callback: F)where F: Fn() + Send + Sync + 'static,
pub fn blockable_bind<F>(self, callback: F)where F: Fn() -> BlockInput + Send + Sync + 'static,
pub fn bind_all<F>(callback: F)where F: Fn(MouseButton) + Send + Sync + Clone + 'static,
pub fn unbind(self)
§impl MouseButton
impl MouseButton
pub fn is_pressed(self) -> bool
pub fn is_pressed(self) -> bool
Returns true if a given MouseButton
is currently pressed (in the down position).
pub fn press(self)
pub fn press(self)
Presses a given MouseButton
. Note: this means the button will remain in the down
position. You must manually call release to create a full ‘click’.
pub fn release(self)
pub fn release(self)
Releases a given MouseButton
. This means the button would be in the up position.
Trait Implementations§
§impl Clone for MouseButton
impl Clone for MouseButton
§fn clone(&self) -> MouseButton
fn clone(&self) -> MouseButton
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 more§impl Debug for MouseButton
impl Debug for MouseButton
§impl From<MouseButton> for Mouse
impl From<MouseButton> for Mouse
§fn from(button: MouseButton) -> Mouse
fn from(button: MouseButton) -> Mouse
Converts to this type from the input type.
§impl From<MouseButton> for u32
impl From<MouseButton> for u32
§fn from(button: MouseButton) -> u32
fn from(button: MouseButton) -> u32
Converts to this type from the input type.
§impl From<u32> for MouseButton
impl From<u32> for MouseButton
§fn from(keycode: u32) -> MouseButton
fn from(keycode: u32) -> MouseButton
Converts to this type from the input type.
§impl Hash for MouseButton
impl Hash for MouseButton
§impl IntoEnumIterator for MouseButton
impl IntoEnumIterator for MouseButton
§impl PartialEq<MouseButton> for MouseButton
impl PartialEq<MouseButton> for MouseButton
§fn eq(&self, other: &MouseButton) -> bool
fn eq(&self, other: &MouseButton) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for MouseButton
impl Eq for MouseButton
impl StructuralEq for MouseButton
impl StructuralPartialEq for MouseButton
Auto Trait Implementations§
impl RefUnwindSafe for MouseButton
impl Send for MouseButton
impl Sync for MouseButton
impl Unpin for MouseButton
impl UnwindSafe for MouseButton
Blanket Implementations§
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.