[][src]Trait cogs_gamedev::controls::InputHandler

pub trait InputHandler<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> {
    pub fn pressed(&self, control: C) -> bool;
pub fn released(&self, control: C) -> bool;
pub fn clicked_down(&self, control: C) -> bool; }

The InputHandler trait, makng sure that both styles of input handling expose the same API.

Required methods

pub fn pressed(&self, control: C) -> bool[src]

Is this input pressed down? i.e. is the player pressing the button?

pub fn released(&self, control: C) -> bool[src]

Is this input released? i.e. is the player not pressing the button?

pub 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?

Loading content...

Implementors

impl<I: Hash + Eq + PartialEq + Clone, C: Enum<u32> + Clone> InputHandler<I, C> for EventInputHandler<I, C>[src]

pub fn pressed(&self, control: C) -> bool[src]

Is this input pressed down? i.e. is the player pressing the button?

pub fn released(&self, control: C) -> bool[src]

Is this input released? i.e. is the player not pressing the button?

pub 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> + Clone> InputHandler<I, C> for PollingInputHandler<I, C>[src]

pub fn pressed(&self, control: C) -> bool[src]

Is this input pressed down? i.e. is the player pressing the button?

pub fn released(&self, control: C) -> bool[src]

Is this input released? i.e. is the player not pressing the button?

pub 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?

Loading content...