#include <tb_input_action.h>
Public Member Functions | |
InputAction (void) | |
InputAction (const tbApplication::Key &keyBinding) | |
~InputAction (void) | |
bool | IsDown (void) const |
bool | IsPressed (void) const |
bool | IsReleased (void) const |
void | ClearBindings (void) |
void | AddBinding (const tbApplication::Key &keyBinding) |
void | RemoveBinding (const tbApplication::Key &keyBinding) |
Static Public Member Functions | |
static void | UpdateActionOnSimulate (bool onSimulateStep=true) |
An object to manage watching one-many keys to perform game actions and hide details about the bound keys from code using the action.
TurtleBrains::Game::InputAction::InputAction | ( | void | ) |
Constructs an InputAction that contains no bindings.
|
explicit |
Constructs an InputAction that binds to the Key given.
keyBinding | The Key to bind to the InputAction object during construction. |
TurtleBrains::Game::InputAction::~InputAction | ( | void | ) |
Destroys the InputAction object.
void TurtleBrains::Game::InputAction::AddBinding | ( | const tbApplication::Key & | keyBinding | ) |
Adds a Key binding to the InputAction so that it will get tracked for Down, Pressed or Released events.
keyBinding | The Key to bind to the InputAction. |
void TurtleBrains::Game::InputAction::ClearBindings | ( | void | ) |
Removes ALL bindings from the input action so there are no keys or inputs that will trigger any of the Down, Pressed or Release events.
bool TurtleBrains::Game::InputAction::IsDown | ( | void | ) | const |
This will check each of the Keys bound to the InputAction to see if ANY of the keys that are bound to the InputAction is Down at the moment, returning true if that is the case.
bool TurtleBrains::Game::InputAction::IsPressed | ( | void | ) | const |
This will check each of the Keys bound to the InputAction to see if ANY of the keys that are bound to the InputAction is Pressed at the moment, returning true if that is the case.
bool TurtleBrains::Game::InputAction::IsReleased | ( | void | ) | const |
This will check each of the Keys bound to the InputAction to see if ANY of the keys that are bound to the InputAction is Pressed at the moment, returning true if that is the case.
void TurtleBrains::Game::InputAction::RemoveBinding | ( | const tbApplication::Key & | keyBinding | ) |
Removes a specific Key from the InputAction while keeping any other Keys as they were.
keyBinding | The Key binding to remove from the InputAction. |
|
static |
This will change when ALL InputAction objects update the status of their Keys from or to the SimulateStep or the UpdateStep portion of the frame.
onSimulateStep | should be true to poll input during each of the 0-N Simulate steps during a frame or false to poll during the Update step. |