Trait cogs_gamedev::controls::InputHandler [−][src]
pub trait InputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> { fn pressed(&self, control: C) -> bool; fn released(&self, control: C) -> bool; fn clicked_down(&self, control: C) -> bool; }
Expand description
The InputHandler trait, makng sure that both styles of input handling expose the same API.
Required methods
fn pressed(&self, control: C) -> bool
[src]
fn pressed(&self, control: C) -> bool
[src]Is this input pressed down? i.e. is the player pressing the button?
fn released(&self, control: C) -> bool
[src]
fn released(&self, control: C) -> bool
[src]Is this input released? i.e. is the player not pressing the button?
fn clicked_down(&self, control: C) -> bool
[src]
fn clicked_down(&self, control: C) -> bool
[src]Is this input being clicked down? i.e. was it up last frame, but down this frame?
Implementors
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> InputHandler<I, C> for PollingInputHandler<I, C>
[src]
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> InputHandler<I, C> for PollingInputHandler<I, C>
[src]fn pressed(&self, control: C) -> bool
[src]
fn pressed(&self, control: C) -> bool
[src]Is this input pressed down? i.e. is the player pressing the button?
fn released(&self, control: C) -> bool
[src]
fn released(&self, control: C) -> bool
[src]Is this input released? i.e. is the player not pressing the button?
fn clicked_down(&self, control: C) -> bool
[src]
fn clicked_down(&self, control: C) -> bool
[src]Is this input being clicked down? i.e. was it up last frame, but down this frame?
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Enum<bool> + Clone> InputHandler<I, C> for EventInputHandler<I, C>
[src]
impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Enum<bool> + Clone> InputHandler<I, C> for EventInputHandler<I, C>
[src]fn pressed(&self, control: C) -> bool
[src]
fn pressed(&self, control: C) -> bool
[src]Is this input pressed down? i.e. is the player pressing the button?
fn released(&self, control: C) -> bool
[src]
fn released(&self, control: C) -> bool
[src]Is this input released? i.e. is the player not pressing the button?
fn clicked_down(&self, control: C) -> bool
[src]
fn clicked_down(&self, control: C) -> bool
[src]Is this input being clicked down? i.e. was it up last frame, but down this frame?