5#include <unordered_map>
21 name =
"JoystickManager";
79 std::unordered_map<SDL_JoystickID, JoystickState>
m_joyStates;
ComponentTypeID GetComponentTypeID_Static()
float GetAxis(SDL_JoystickID id, int axis)
void PostJoystickButtonEvent(SDL_JoystickID which, int button, bool down)
bool GetButton(SDL_JoystickID id, int button)
bool IsButtonReleased(SDL_JoystickID id, int button)
bool IsButtonPressed(SDL_JoystickID id, int button)
std::unordered_map< SDL_JoystickID, JoystickState > m_joyStates
static constexpr int MAX_BUTTONS
virtual ~JoystickManager()
bool IsJoystickConnected(SDL_JoystickID id)
static JoystickManager & GetInstance()
static JoystickManager & Get()
void OpenJoystick(SDL_JoystickID instance_id)
void PostJoystickConnectedEvent(SDL_JoystickID which, bool bconnected)
void HandleEvent(const SDL_Event *ev)
void CloseJoystick(SDL_JoystickID instance_id)
std::unordered_map< SDL_JoystickID, JoystickInfo > m_joysticks
std::vector< SDL_JoystickID > GetConnectedJoysticks()
void PostJoystickAxisEvent(SDL_JoystickID which, int axis, Sint16 value)
static constexpr int MAX_AXES
std::vector< Sint16 > axes
std::vector< bool > buttons
bool buttonsReleased[MAX_BUTTONS]
bool buttons[MAX_BUTTONS]
bool buttonsPressed[MAX_BUTTONS]