InputManager class to handle input events and actions.
More...
#include <InputManager.h>
|
| enum class | Key |
| | A list of every key that can be bound to an action.
|
| |
|
| void | registerAction (const std::string &actionName, const std::vector< Key > &keys, std::function< void(bool)> callback, const std::string &context="Default") |
| | Register an action with a name, key bindings, and a callback function.
|
| |
| void | setActiveContext (const std::string &context) |
| | set the active context, is "Default" by default
|
| |
|
std::string | getActiveContext () const |
| | Get the active context.
|
| |
InputManager class to handle input events and actions.
This class manages input events, allowing for the registration of actions and their corresponding key bindings.
◆ registerAction()
| void InputManager::registerAction |
( |
const std::string & | actionName, |
|
|
const std::vector< Key > & | keys, |
|
|
std::function< void(bool)> | callback, |
|
|
const std::string & | context = "Default" ) |
Register an action with a name, key bindings, and a callback function.
- Parameters
-
| actionName | The name of the action |
| keys | The keys that are bound to this action |
| callback | The function to call when the action is triggered |
| context | The context in which the action is valid can be used to switch between e.g. gameplay and menu so the same keys can be used for different actions |
◆ setActiveContext()
| void InputManager::setActiveContext |
( |
const std::string & | context | ) |
|
set the active context, is "Default" by default
- Parameters
-
| context | The name of the context to set as active |
The documentation for this class was generated from the following files: