pub enum ButtonState {
Released,
JustPressed,
Pressed,
JustReleased,
}Expand description
Touch/Mouse button state
Variants§
Released
Not pressed
JustPressed
Just pressed this frame
Pressed
Held down
JustReleased
Just released this frame
Implementations§
Source§impl ButtonState
impl ButtonState
Sourcepub const fn just_pressed(self) -> bool
pub const fn just_pressed(self) -> bool
Returns true if the button was just pressed
Sourcepub const fn just_released(self) -> bool
pub const fn just_released(self) -> bool
Returns true if the button was just released
Trait Implementations§
Source§impl Clone for ButtonState
impl Clone for ButtonState
Source§fn clone(&self) -> ButtonState
fn clone(&self) -> ButtonState
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 ButtonState
impl Debug for ButtonState
Source§impl Default for ButtonState
impl Default for ButtonState
Source§fn default() -> ButtonState
fn default() -> ButtonState
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ButtonState
impl<'de> Deserialize<'de> for ButtonState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for ButtonState
impl Hash for ButtonState
Source§impl PartialEq for ButtonState
impl PartialEq for ButtonState
Source§impl Serialize for ButtonState
impl Serialize for ButtonState
impl Copy for ButtonState
impl Eq for ButtonState
impl StructuralPartialEq for ButtonState
Auto Trait Implementations§
impl Freeze for ButtonState
impl RefUnwindSafe for ButtonState
impl Send for ButtonState
impl Sync for ButtonState
impl Unpin for ButtonState
impl UnwindSafe for ButtonState
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