High-level API for collections of input action maps.
More...
#include <InputStateMapper.hpp>
|
|
| InputStateMapper (void) |
| | Default constructor.
|
|
| ~InputStateMapper (void) |
| | Destructor.
|
| bool | active (const std::string &key) const |
| | Obtain active state status.
|
| bool | insert (const std::string &key, const InputActionMapper &map, bool active) |
| | Add action mappings to an input state.
|
| bool | erase (const std::string &key) |
| | Remove a state.
|
| bool | activate (const std::string &key) |
| | Activate a state.
|
| bool | disable (const std::string &key) |
| | Disable a state.
|
|
void | disable (void) |
| | Disable all input states.
|
| bool | activate_only (const std::string &key) |
| | Enable only a particular state.
|
|
void | clear (void) |
| | Empty the container of input states.
|
| void | dump () |
| | Diagnostic output.
|
| void | set_event_handler (EventHandler &evt_handler) |
| | Install the event handler used by the interface.
|
|
|
void | on_event (const Event &ev) |
| | Internal event handler for triggering mapped action states.
|
|
bool | on_key_press (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a keyboard action to a keyboard event.
|
|
bool | on_mouse_button (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a mouse button action to a mouse button event.
|
|
bool | on_mouse_wheel (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a mouse wheel action to a mouse wheel event.
|
|
bool | on_joystick_button (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a joystick button action to a joystick button event.
|
|
bool | on_joystick_axis (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a joystick axis action to a joystick axis event.
|
|
bool | on_joystick_hat (const InputAction &mapping, const Event &ev) |
|
bool | on_game_controller_button (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a game controller button action to an equivalent event.
|
|
bool | on_game_controller_axis (const InputAction &mapping, const Event &ev) |
| | Internal event handler for matching a game controller axis action to an equivalent event.
|
High-level API for collections of input action maps.
Definition at line 53 of file InputStateMapper.hpp.
◆ InputStateMap
| typedef std::map<std::string, InputActionState> nom::InputStateMapper::InputStateMap |
◆ Pair
◆ SelfType
◆ activate()
| bool nom::InputStateMapper::activate |
( |
const std::string & | key | ) |
|
Activate a state.
- Parameters
-
| key | The state string index to activate. |
◆ activate_only()
| bool nom::InputStateMapper::activate_only |
( |
const std::string & | key | ) |
|
Enable only a particular state.
◆ active()
| bool nom::InputStateMapper::active |
( |
const std::string & | key | ) |
const |
Obtain active state status.
- Parameters
-
| key | The state string index to query. |
◆ disable()
| bool nom::InputStateMapper::disable |
( |
const std::string & | key | ) |
|
Disable a state.
- Parameters
-
| key | The state string index to disable. |
◆ dump()
| void nom::InputStateMapper::dump |
( |
| ) |
|
Diagnostic output.
remarks Dumps only the active states.
◆ erase()
| bool nom::InputStateMapper::erase |
( |
const std::string & | key | ) |
|
Remove a state.
- Parameters
-
| key | The state string index to remove. |
◆ insert()
| bool nom::InputStateMapper::insert |
( |
const std::string & | key, |
|
|
const InputActionMapper & | map, |
|
|
bool | active ) |
Add action mappings to an input state.
- Parameters
-
| key | The state string index associated with the input action container. |
| map | A nom::InputActionMapper object with your input action maps to be assigned to a state. |
| active | Toggle the active state of the input mappings. |
◆ set_event_handler()
| void nom::InputStateMapper::set_event_handler |
( |
EventHandler & | evt_handler | ) |
|
Install the event handler used by the interface.
- Note
- The installed event handler must outlive the destruction of this interface!
◆ event_handler_
| EventHandler* nom::InputStateMapper::event_handler_ = nullptr |
|
private |
◆ states_
| InputStateMap nom::InputStateMapper::states_ |
|
private |
The documentation for this class was generated from the following file: