Struct amethyst_input::InputHandler [] [src]

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]

[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]

[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.

[src]

Returns an iterator over all keys that are down.

[src]

Checks if a key is down.

[src]

Returns an iterator over all pressed mouse buttons

[src]

Checks if a mouse button is down.

[src]

Returns an iterator over all pressed scan codes

[src]

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

[src]

Gets the current mouse position.

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

Important traits for Buttons<'a>
[src]

Returns an iterator over all buttons that are down.

[src]

Checks if a button is down.

[src]

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

[src]

Returns true if any of the action keys are down.

Trait Implementations

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

[src]

Returns the "default value" for a type. Read more

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