#include <gInputManager.h>
Central input manager that tracks raw device state and manages per-player input contexts. Supports keyboard+mouse and up to 16 gamepads.
Player 0 is created automatically and assigned to keyboard+mouse. Additional players can be created for local co-op.
Example - single player with keyboard + gamepad fallback:
#define G_KEY_A
Definition gKeyCode.h:25
#define G_GAMEPAD_AXIS_LEFT_X
Definition gKeyCode.h:152
#define G_KEY_D
Definition gKeyCode.h:28
Example - local co-op:
#define G_GAMEPAD_BUTTON_A
Definition gKeyCode.h:131
◆ AxisBinding
◆ gInputManager()
| gInputManager::gInputManager |
( |
| ) |
|
◆ ~gInputManager()
| gInputManager::~gInputManager |
( |
| ) |
|
◆ getGamepadAxisValue()
| float gInputManager::getGamepadAxisValue |
( |
int |
gamepadId, |
|
|
int |
axisId |
|
) |
| const |
◆ getMouseDelta()
| void gInputManager::getMouseDelta |
( |
float & |
dx, |
|
|
float & |
dy |
|
) |
| const |
◆ getPlayer()
Returns the player at the given index. Creates it if it doesn't exist. Player 0 always exists and has KB+M assigned by default.
◆ getPlayerCount()
| int gInputManager::getPlayerCount |
( |
| ) |
const |
Returns the number of players currently created.
◆ isGamepadButtonJustPressed()
| bool gInputManager::isGamepadButtonJustPressed |
( |
int |
gamepadId, |
|
|
int |
buttonId |
|
) |
| const |
◆ isGamepadButtonPressed()
| bool gInputManager::isGamepadButtonPressed |
( |
int |
gamepadId, |
|
|
int |
buttonId |
|
) |
| const |
◆ isGamepadConnected()
| bool gInputManager::isGamepadConnected |
( |
int |
gamepadId | ) |
const |
◆ isKeyJustPressed()
| bool gInputManager::isKeyJustPressed |
( |
int |
keyCode | ) |
const |
◆ isKeyPressed()
| bool gInputManager::isKeyPressed |
( |
int |
keyCode | ) |
const |
◆ update()
| void gInputManager::update |
( |
| ) |
|
Resets per-frame state and polls gamepads. Called by gAppManager at the start of each tick.
◆ MAXGAMEPADAXES
| const int gInputManager::MAXGAMEPADAXES = 6 |
|
static |
◆ MAXGAMEPADBUTTONS
| const int gInputManager::MAXGAMEPADBUTTONS = 15 |
|
static |
◆ MAXGAMEPADS
| const int gInputManager::MAXGAMEPADS = 16 |
|
static |
The documentation for this class was generated from the following file: