pub trait InputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> {
// Required methods
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§
Sourcefn pressed(&self, control: C) -> bool
fn pressed(&self, control: C) -> bool
Is this input pressed down? i.e. is the player pressing the button?
Sourcefn released(&self, control: C) -> bool
fn released(&self, control: C) -> bool
Is this input released? i.e. is the player not pressing the button?
Sourcefn 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?