Expand description
A collection of abstractions for various input devices to be used with Amethyst.
Structs§
- Bindings
- Used for saving and loading input settings.
- Input
Bundle - Bundle for adding the
InputHandler. - Input
Handler - This struct holds state information about input devices.
- Input
System - Input system
- Input
System Desc - Builds an
InputSystem. - String
Bindings - The builtin
BindingTypesimplementation, set of types for binding configuration keys. UsesStringfor both axes and actions. Usage of this type is discouraged and it’s meant mainly for prototypes. CheckBindingTypesfor examples.
Enums§
- Axis
- Represents any input represented by a float value from -1 to 1. Retrieve the value of this with axis_value.
- Binding
Error - An enum of possible errors that can occur when binding an action or axis.
- Bindings
File Error - An error occurred while loading the bindings file.
- Button
- A Button is any kind of digital input that the engine supports.
- Controller
Axis - Controller axes matching SDL controller model
- Controller
Button - Controller buttons matching SDL controller model
- Controller
Event - Controller events generated by the SDL events system.
- Element
State - Describes the input state of a key.
- Input
Event - Events generated by the input system
- Mouse
Axis - Mouse axis
- Scroll
Direction - Indicates in what direction a mouse wheel scroll event was.
- Virtual
KeyCode - Symbolic name for a keyboard key.
Traits§
- Binding
Types - Define a set of types used for bindings configuration.
Usually defaulted to
StringBindings, which usesStrings.
Functions§
- get_
input_ axis_ simple - Gets the input axis value from the
InputHandler. If the name is None, it will return the default value of the axis (0.0). - get_key
- If this event was for manipulating a keyboard key then this will return the
VirtualKeyCodeand the new state. - get_
mouse_ button - If this event was for manipulating a mouse button, this will return the
MouseButtonand the new state. - is_
close_ requested - Returns true if the event passed in is a request to close the game window.
- is_
key_ down - Returns true if the event passed in is a key down event for the
provided
VirtualKeyCode. - is_
key_ up - Returns true if the event passed in is a key up event for the
provided
VirtualKeyCode. - is_
mouse_ button_ down - Returns true if the event passed in is a mouse button down event for the
provided
MouseButton.