[][src]Struct ggez_goodies::input::InputState

pub struct InputState<Axes, Buttons> where
    Axes: Hash + Eq + Clone,
    Buttons: Hash + Eq + Clone
{ /* fields omitted */ }

The object that tracks the current state of the input controls, such as axes, bindings, etc.

Methods

impl<Axes, Buttons> InputState<Axes, Buttons> where
    Axes: Eq + Hash + Clone,
    Buttons: Eq + Hash + Clone
[src]

pub fn new() -> Self[src]

pub fn update(&mut self, dt: f32)[src]

Updates the logical input state based on the actual physical input state. Should be called in your update() handler. It will do things like move the axes and so on.

pub fn update_button_down(&mut self, button: Buttons)[src]

This method should get called by your key_down_event handler.

pub fn update_button_up(&mut self, button: Buttons)[src]

This method should get called by your key_up_event handler.

pub fn update_axis_start(&mut self, axis: Axes, positive: bool)[src]

This method should get called by your key_down_event handler.

pub fn update_axis_stop(&mut self, axis: Axes, positive: bool)[src]

This method should get called by your key_up_event handler.

pub fn update_effect(
    &mut self,
    effect: InputEffect<Axes, Buttons>,
    started: bool
)
[src]

Takes an InputEffect and actually applies it.

pub fn get_axis(&self, axis: Axes) -> f32[src]

pub fn get_axis_raw(&self, axis: Axes) -> f32[src]

pub fn get_button_down(&self, axis: Buttons) -> bool[src]

pub fn get_button_up(&self, axis: Buttons) -> bool[src]

pub fn get_button_pressed(&self, axis: Buttons) -> bool[src]

Returns whether or not the button was pressed this frame, only returning true if the press happened this frame.

Basically, get_button_down() and get_button_up() are level triggers, this and get_button_released() are edge triggered.

pub fn get_button_released(&self, axis: Buttons) -> bool[src]

pub fn mouse_position()[src]

pub fn mouse_scroll_delta()[src]

pub fn get_mouse_button()[src]

pub fn get_mouse_button_down()[src]

pub fn get_mouse_button_up()[src]

pub fn reset_input_state(&mut self)[src]

Trait Implementations

impl<Axes: Clone, Buttons: Clone> Clone for InputState<Axes, Buttons> where
    Axes: Hash + Eq + Clone,
    Buttons: Hash + Eq + Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<Axes: Debug, Buttons: Debug> Debug for InputState<Axes, Buttons> where
    Axes: Hash + Eq + Clone,
    Buttons: Hash + Eq + Clone
[src]

Auto Trait Implementations

impl<Axes, Buttons> Sync for InputState<Axes, Buttons> where
    Axes: Sync,
    Buttons: Sync

impl<Axes, Buttons> Send for InputState<Axes, Buttons> where
    Axes: Send,
    Buttons: Send

impl<Axes, Buttons> Unpin for InputState<Axes, Buttons> where
    Axes: Unpin,
    Buttons: Unpin

impl<Axes, Buttons> RefUnwindSafe for InputState<Axes, Buttons> where
    Axes: RefUnwindSafe,
    Buttons: RefUnwindSafe

impl<Axes, Buttons> UnwindSafe for InputState<Axes, Buttons> where
    Axes: UnwindSafe,
    Buttons: UnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.