pub struct ButtonMap<T: Copy + Eq + Hash> { /* private fields */ }Expand description
Button map resource for button presses
Implementations§
Source§impl<T: Copy + Eq + Hash> ButtonMap<T>
impl<T: Copy + Eq + Hash> ButtonMap<T>
Sourcepub fn release_all(&mut self)
pub fn release_all(&mut self)
Release all currently held inputs.
Sourcepub fn any_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn any_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
Returns true if any of the inputs are pressed.
Sourcepub fn all_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn all_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
Returns true if all of the inputs are pressed.
Sourcepub fn just_pressed(&self, input: T) -> bool
pub fn just_pressed(&self, input: T) -> bool
Returns true if the input was just pressed.
Sourcepub fn any_just_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn any_just_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
Returns true if any of the inputs have just been pressed.
Sourcepub fn all_just_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn all_just_pressed(&self, inputs: impl IntoIterator<Item = T>) -> bool
Reutns true if all of the inputs have just been pressed.
Sourcepub fn just_released(&self, input: T) -> bool
pub fn just_released(&self, input: T) -> bool
Returns true if the input was just released.
Sourcepub fn any_just_released(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn any_just_released(&self, inputs: impl IntoIterator<Item = T>) -> bool
Returns true if any of the inputs have just been released.
Sourcepub fn all_just_released(&self, inputs: impl IntoIterator<Item = T>) -> bool
pub fn all_just_released(&self, inputs: impl IntoIterator<Item = T>) -> bool
Returns true if all of the inputs have just been released.
Sourcepub fn get_pressed(&self) -> impl ExactSizeIterator<Item = &T>
pub fn get_pressed(&self) -> impl ExactSizeIterator<Item = &T>
Get every pressed input.
Sourcepub fn get_just_pressed(&self) -> impl ExactSizeIterator<Item = &T>
pub fn get_just_pressed(&self) -> impl ExactSizeIterator<Item = &T>
Get every just pressed input.
Sourcepub fn get_just_released(&self) -> impl ExactSizeIterator<Item = &T>
pub fn get_just_released(&self) -> impl ExactSizeIterator<Item = &T>
Get every just released input.
Trait Implementations§
impl<T: Eq + Copy + Eq + Hash> Eq for ButtonMap<T>
impl<T: Copy + Eq + Hash> StructuralPartialEq for ButtonMap<T>
Auto Trait Implementations§
impl<T> Freeze for ButtonMap<T>
impl<T> RefUnwindSafe for ButtonMap<T>where
T: RefUnwindSafe,
impl<T> Send for ButtonMap<T>where
T: Send,
impl<T> Sync for ButtonMap<T>where
T: Sync,
impl<T> Unpin for ButtonMap<T>where
T: Unpin,
impl<T> UnsafeUnpin for ButtonMap<T>
impl<T> UnwindSafe for ButtonMap<T>where
T: UnwindSafe,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more