![]() |
Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
|
#include <input.hpp>
Public Member Functions | |
| int | actionAddEvent (const std::string &name, std::unique_ptr< InputEvent > event) |
| void | actionRemoveEvent (const std::string &action, int index) |
| void | actionRemoveEvents (const std::string &action) |
| float | actionGetDeadzone (const std::string &action) const |
| std::vector< InputEvent > | actionGetEvents (std::string action) |
| void | actionSetDeadzone (const std::string &action, float deadzone) |
| void | addAction (const std::string &action, float deadzone=0.1f) |
| void | removeAction (const std::string &action) |
| bool | eventIsAction (const InputEvent *event, const std::string &name, bool identityCheck=false) |
| std::vector< std::string > | getActions () |
| bool | hasAction (const std::string &action) const |
| std::unordered_map< std::string, InputRegistryAction > * | getActionsArray () |
The InputRegistry allows you to define actions which are binded to specific events (like, for example InputEventKey). Once you add an action, you can bind an event to it using actionAddEvent().
Once you do that, you can check on a scripts input function if the event is a specific action:
Make sure to also check out the input example!
| int InputRegistry::actionAddEvent | ( | const std::string & | name, |
| std::unique_ptr< InputEvent > | event | ||
| ) |
| float InputRegistry::actionGetDeadzone | ( | const std::string & | action | ) | const |
| std::vector< InputEvent > InputRegistry::actionGetEvents | ( | std::string | action | ) |
| void InputRegistry::actionRemoveEvent | ( | const std::string & | action, |
| int | index | ||
| ) |
| void InputRegistry::actionRemoveEvents | ( | const std::string & | action | ) |
| void InputRegistry::actionSetDeadzone | ( | const std::string & | action, |
| float | deadzone | ||
| ) |
| void InputRegistry::addAction | ( | const std::string & | action, |
| float | deadzone = 0.1f |
||
| ) |
| bool InputRegistry::eventIsAction | ( | const InputEvent * | event, |
| const std::string & | name, | ||
| bool | identityCheck = false |
||
| ) |
| std::vector< std::string > InputRegistry::getActions | ( | ) |
| std::unordered_map< std::string, InputRegistryAction > * InputRegistry::getActionsArray | ( | ) |
| bool InputRegistry::hasAction | ( | const std::string & | action | ) | const |
| void InputRegistry::removeAction | ( | const std::string & | action | ) |