[][src]Struct amethyst_input::InputHandler

pub struct InputHandler<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
{ pub bindings: Bindings<AX, AC>, // some fields omitted }

This struct holds state information about input devices.

For example, if a key is pressed on the keyboard, this struct will record that the key is pressed until it is released again.

Fields

Maps inputs to actions and axes.

Methods

impl<AX, AC> InputHandler<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
[src]

Creates a new input handler.

impl<AX, AC> InputHandler<AX, AC> where
    AX: Hash + Eq + Clone + Send + Sync + 'static,
    AC: Hash + Eq + Clone + Send + Sync + 'static, 
[src]

Updates the input handler with a new engine event.

The Amethyst game engine will automatically call this if the InputHandler is attached to the world as a resource with id 0.

Updates the input handler with a new controller event.

Called internally from SdlEventsSystem when using sdl_controller feature. You should invoke it in your system if you provide your own controller input implementation.

Returns an iterator over all keys that are down.

Checks if a key is down.

Returns an iterator over all pressed mouse buttons

Checks if a mouse button is down.

Returns an iterator over all pressed scan codes

Checks if the key corresponding to a scan code is down.

Returns an iterator over all pressed controller buttons on all controllers.

Checks if a controller button is down on specific controller.

List controller ids of all currently connected controllers. IDs are assigned sequentially in the order of connection starting from 0, always taking the lowest next free number.

Returns true if a controller with the given id is connected.

Gets the current mouse position.

this method can return None, either if no mouse is connected, or if no mouse events have been recorded

Returns an iterator over all buttons that are down.

Checks if a button is down.

Returns the value of an axis by the string id, if the id doesn't exist this returns None.

Returns true if any of the actions bindings is down.

If a binding represents a combination of buttons, all of them need to be down.

Trait Implementations

impl<AX, AC> Default for InputHandler<AX, AC> where
    AX: Hash + Eq,
    AC: Hash + Eq
[src]

Auto Trait Implementations

impl<AX, AC> Send for InputHandler<AX, AC> where
    AC: Send,
    AX: Send

impl<AX, AC> Sync for InputHandler<AX, AC> where
    AC: Sync,
    AX: Sync

Blanket Implementations

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

impl<T> From for T
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

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

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

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

impl<T> Same for T

Should always be Self

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

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> TryDefault for T where
    T: Default

Calls try_default and panics on an error case.

impl<T> Any for T where
    T: Any

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> Erased for T

impl<T> Erased for T

impl<T> SetParameter for T

Sets value as a parameter of self.