pub struct PollingInputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> { /* private fields */ }
Expand description
Polling-based input handler. See module-level documentation for more.
Implementations§
Trait Implementations§
Source§impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> Clone for PollingInputHandler<I, C>
EnumMap doesn’t implement Clone so we do it ourselves
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> Clone for PollingInputHandler<I, C>
EnumMap doesn’t implement Clone so we do it ourselves
Source§impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> InputHandler<I, C> for PollingInputHandler<I, C>
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> InputHandler<I, C> for PollingInputHandler<I, C>
Source§fn pressed(&self, control: C) -> bool
fn pressed(&self, control: C) -> bool
Is this input pressed down? i.e. is the player pressing the button?
Source§fn released(&self, control: C) -> bool
fn released(&self, control: C) -> bool
Is this input released? i.e. is the player not pressing the button?
Source§fn clicked_down(&self, control: C) -> bool
fn clicked_down(&self, control: C) -> bool
Is this input being clicked down? i.e. was it up last frame, but down this frame?
Auto Trait Implementations§
impl<I, C> Freeze for PollingInputHandler<I, C>
impl<I, C> RefUnwindSafe for PollingInputHandler<I, C>
impl<I, C> Send for PollingInputHandler<I, C>
impl<I, C> Sync for PollingInputHandler<I, C>
impl<I, C> Unpin for PollingInputHandler<I, C>
impl<I, C> UnwindSafe for PollingInputHandler<I, C>
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