[][src]Struct ggez_goodies::input::InputBinding

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

A struct that contains a mapping from physical input events (currently just KeyCodes) to whatever your logical Axis/Button types are.

Methods

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

pub fn new() -> Self[src]

pub fn bind_key_to_axis(
    self,
    keycode: KeyCode,
    axis: Axes,
    positive: bool
) -> Self
[src]

Adds a key binding connecting the given keycode to the given logical axis.

pub fn bind_key_to_button(self, keycode: KeyCode, button: Buttons) -> Self[src]

Adds a key binding connecting the given keycode to the given logical button.

pub fn resolve(&self, keycode: KeyCode) -> Option<InputEffect<Axes, Buttons>>[src]

Takes an physical input type and turns it into a logical input type (keycode -> axis/button).

Trait Implementations

impl<Axes: Clone, Buttons: Clone> Clone for InputBinding<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: PartialEq, Buttons: PartialEq> PartialEq<InputBinding<Axes, Buttons>> for InputBinding<Axes, Buttons> where
    Axes: Hash + Eq + Clone,
    Buttons: Hash + Eq + Clone
[src]

Auto Trait Implementations

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

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

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

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

impl<Axes, Buttons> UnwindSafe for InputBinding<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.