Antkeeper
0.0.1
|
Maps input to a set of contextually-related actions. More...
#include <action-map.hpp>
Public Member Functions | |
void | enable () |
Enables the mapping of input events to actions. More... | |
void | disable () |
Disables the mapping of input events to actions. More... | |
void | reset () |
Resets the activation states of each action in the action map. More... | |
void | set_event_dispatcher (event::dispatcher *dispatcher) |
Sets the event dispatcher from which this action map will receive input events. More... | |
void | remove_mappings (action &action, mapping_type type) |
Unmaps input from an action. More... | |
void | remove_mappings (action &action) |
Unmaps all input from an action. More... | |
void | remove_mappings () |
Unmaps all input from all actions in the action map. More... | |
std::vector< gamepad_axis_mapping > | get_gamepad_axis_mappings (const action &action) const |
Returns all of the gamepad axis mappings associated with an action. More... | |
std::vector< gamepad_button_mapping > | get_gamepad_button_mappings (const action &action) const |
Returns all of the gamepad button mappings associated with an action. More... | |
std::vector< key_mapping > | get_key_mappings (const action &action) const |
Returns all of the key mappings associated with an action. More... | |
std::vector< mouse_button_mapping > | get_mouse_button_mappings (const action &action) const |
Returns all of the mouse button mappings associated with an action. More... | |
std::vector< mouse_motion_mapping > | get_mouse_motion_mappings (const action &action) const |
Returns all of the mouse motion mappings associated with an action. More... | |
std::vector< mouse_scroll_mapping > | get_mouse_scroll_mappings (const action &action) const |
Returns all of the mouse scroll associated with an action. More... | |
constexpr bool | is_enabled () const noexcept |
Returns true if the action map is enabled, false otherwise. More... | |
void | add_mapping (action &action, const mapping &mapping) |
Maps input to an action. More... | |
void | add_gamepad_axis_mapping (action &action, gamepad_axis_mapping mapping) |
Maps input to an action. More... | |
void | add_gamepad_button_mapping (action &action, gamepad_button_mapping mapping) |
Maps input to an action. More... | |
void | add_key_mapping (action &action, key_mapping mapping) |
Maps input to an action. More... | |
void | add_mouse_button_mapping (action &action, mouse_button_mapping mapping) |
Maps input to an action. More... | |
void | add_mouse_motion_mapping (action &action, mouse_motion_mapping mapping) |
Maps input to an action. More... | |
void | add_mouse_scroll_mapping (action &action, mouse_scroll_mapping mapping) |
Maps input to an action. More... | |
Maps input to a set of contextually-related actions.
Definition at line 42 of file action-map.hpp.
void input::action_map::add_gamepad_axis_mapping | ( | action & | action, |
gamepad_axis_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 121 of file action-map.cpp.
void input::action_map::add_gamepad_button_mapping | ( | action & | action, |
gamepad_button_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 127 of file action-map.cpp.
void input::action_map::add_key_mapping | ( | action & | action, |
key_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 133 of file action-map.cpp.
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 87 of file action-map.cpp.
void input::action_map::add_mouse_button_mapping | ( | action & | action, |
mouse_button_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 139 of file action-map.cpp.
void input::action_map::add_mouse_motion_mapping | ( | action & | action, |
mouse_motion_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 145 of file action-map.cpp.
void input::action_map::add_mouse_scroll_mapping | ( | action & | action, |
mouse_scroll_mapping | mapping | ||
) |
Maps input to an action.
action | Action to which input will be mapped. |
mapping | Input mapping to add. |
Definition at line 151 of file action-map.cpp.
void input::action_map::disable | ( | ) |
Disables the mapping of input events to actions.
Definition at line 41 of file action-map.cpp.
void input::action_map::enable | ( | ) |
Enables the mapping of input events to actions.
Definition at line 28 of file action-map.cpp.
std::vector< gamepad_axis_mapping > input::action_map::get_gamepad_axis_mappings | ( | const action & | action | ) | const |
Returns all of the gamepad axis mappings associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 412 of file action-map.cpp.
std::vector< gamepad_button_mapping > input::action_map::get_gamepad_button_mappings | ( | const action & | action | ) | const |
Returns all of the gamepad button mappings associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 427 of file action-map.cpp.
std::vector< key_mapping > input::action_map::get_key_mappings | ( | const action & | action | ) | const |
Returns all of the key mappings associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 442 of file action-map.cpp.
std::vector< mouse_button_mapping > input::action_map::get_mouse_button_mappings | ( | const action & | action | ) | const |
Returns all of the mouse button mappings associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 457 of file action-map.cpp.
std::vector< mouse_motion_mapping > input::action_map::get_mouse_motion_mappings | ( | const action & | action | ) | const |
Returns all of the mouse motion mappings associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 472 of file action-map.cpp.
std::vector< mouse_scroll_mapping > input::action_map::get_mouse_scroll_mappings | ( | const action & | action | ) | const |
Returns all of the mouse scroll associated with an action.
action | Action with which associated mappings will be returned. |
Definition at line 487 of file action-map.cpp.
|
inlineconstexprnoexcept |
Returns true
if the action map is enabled, false
otherwise.
Definition at line 146 of file action-map.hpp.
void input::action_map::remove_mappings | ( | ) |
Unmaps all input from all actions in the action map.
Definition at line 258 of file action-map.cpp.
void input::action_map::remove_mappings | ( | action & | action | ) |
Unmaps all input from an action.
action | Action from which input will be unmapped. |
Definition at line 241 of file action-map.cpp.
void input::action_map::remove_mappings | ( | action & | action, |
mapping_type | type | ||
) |
Unmaps input from an action.
action | Action from which input will be unmapped. |
type | Type of input mapping to remove. |
Definition at line 157 of file action-map.cpp.
void input::action_map::reset | ( | ) |
Resets the activation states of each action in the action map.
Definition at line 54 of file action-map.cpp.
void input::action_map::set_event_dispatcher | ( | event::dispatcher * | dispatcher | ) |
Sets the event dispatcher from which this action map will receive input events.
dispatcher | Event dispatcher from which this action map will receive input events. |
Definition at line 62 of file action-map.cpp.