Struct cogs_gamedev::controls::EventInputHandler [−][src]
pub struct EventInputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Enum<bool> + Clone> { /* fields omitted */ }
Expand description
Event-based input handler See module-level documentation for more detail.
Implementations
Create a new EventInputHandler with the specified controls. The HashMap in should map inputs to the controls you want them to actuate.
Call this function when your game engine gives you a KeyDown event, or any event signaling that an input is newly pressed down.
Call this function when your game engine gives you a KeyUp event, or any event signaling that an input has been released.
Manually clear all the inputs the handler has received.
(I’m not sure why you would want to do this, but hey, might as well expose the functionality.)
Trait Implementations
EnumMap doesn’t implement Clone so we do it ourselves
Is this input pressed down? i.e. is the player pressing the button?
Is this input released? i.e. is the player not pressing the button?
Is this input being clicked down? i.e. was it up last frame, but down this frame?
Auto Trait Implementations
impl<I, C> RefUnwindSafe for EventInputHandler<I, C> where
C: RefUnwindSafe,
I: RefUnwindSafe,
<C as Enum<bool>>::Array: RefUnwindSafe,
<C as Enum<u32>>::Array: RefUnwindSafe,
impl<I, C> Send for EventInputHandler<I, C> where
C: Send,
I: Send,
<C as Enum<bool>>::Array: Send,
<C as Enum<u32>>::Array: Send,
impl<I, C> Sync for EventInputHandler<I, C> where
C: Sync,
I: Sync,
<C as Enum<bool>>::Array: Sync,
<C as Enum<u32>>::Array: Sync,
impl<I, C> Unpin for EventInputHandler<I, C> where
C: Unpin,
I: Unpin,
<C as Enum<bool>>::Array: Unpin,
<C as Enum<u32>>::Array: Unpin,
impl<I, C> UnwindSafe for EventInputHandler<I, C> where
C: UnwindSafe,
I: UnwindSafe,
<C as Enum<bool>>::Array: UnwindSafe,
<C as Enum<u32>>::Array: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V