Logical controller for one input channel. More...
#include <InputController.h>
Public Member Functions | |
| InputController (int channel) | |
| void | update (const InputPadData &data, float deltaTime) |
| Updates the controller state. | |
| void | setSideways (bool s) |
| Sets whether the Wiimote is held sideways; if so the d-pad and primary/secondary buttons are remapped (A/B become 2/1). | |
| bool | isSideways () const |
| int | getChannel () const |
| void | setChannel (int c) |
| Temporarily overrides the channel this controller reports via getChannel(). | |
| void | setContinuousRumble (bool continuous) |
| Holds this controller's motor on or off (see InputDriver::setContinuousRumble()). | |
| const InputPadData & | getPadData () const |
| bool | isPressed (uint32_t logicalButtonMask) const |
| bool | isHeld (uint32_t logicalButtonMask) const |
| bool | isPrimaryPressed () const |
| bool | isSecondaryPressed () const |
| bool | up () const |
| bool | down () const |
| bool | left () const |
| bool | right () const |
Logical controller for one input channel.
Translates an InputPadData snapshot (sideways Wiimote mapping, deadzone) and drives repeat-delay timing for UI navigation.
Definition at line 16 of file InputController.h.
| InputController::InputController | ( | int | channel | ) |
| channel | Controller channel (0-3) this controller reports for |
Definition at line 22 of file InputController.cpp.
| bool InputController::down | ( | ) | const |
Definition at line 89 of file InputController.cpp.
|
inline |
Definition at line 34 of file InputController.h.
|
inline |
Definition at line 48 of file InputController.h.
| bool InputController::isHeld | ( | uint32_t | logicalButtonMask | ) | const |
Definition at line 80 of file InputController.cpp.
| bool InputController::isPressed | ( | uint32_t | logicalButtonMask | ) | const |
Definition at line 76 of file InputController.cpp.
| bool InputController::isPrimaryPressed | ( | ) | const |
Definition at line 66 of file InputController.cpp.
| bool InputController::isSecondaryPressed | ( | ) | const |
Definition at line 71 of file InputController.cpp.
|
inline |
Definition at line 32 of file InputController.h.
| bool InputController::left | ( | ) | const |
Definition at line 94 of file InputController.cpp.
| bool InputController::right | ( | ) | const |
Definition at line 99 of file InputController.cpp.
|
inline |
Temporarily overrides the channel this controller reports via getChannel().
Used by list-based elements (e.g. GuiFileBrowser) to present a "no channel" (-1) identity to items the cursor isn't currently over, so a stale stateChan left on a reused slot can't block clicks from the real channel. Callers MUST restore the original value (see getChannel()) after the element update() call this wraps.
Definition at line 42 of file InputController.h.
| void InputController::setContinuousRumble | ( | bool | continuous | ) |
Holds this controller's motor on or off (see InputDriver::setContinuousRumble()).
Definition at line 104 of file InputController.cpp.
|
inline |
Sets whether the Wiimote is held sideways; if so the d-pad and primary/secondary buttons are remapped (A/B become 2/1).
Definition at line 30 of file InputController.h.
| bool InputController::up | ( | ) | const |
Definition at line 84 of file InputController.cpp.
| void InputController::update | ( | const InputPadData & | data, |
| float | deltaTime ) |
Updates the controller state.
Called once per frame by the driver.
| data | The raw, mapped inputs from the hardware. |
| deltaTime | Elapsed time since last frame in seconds. |
Definition at line 29 of file InputController.cpp.