2013-11-05 12:49:23 +00:00
|
|
|
#pragma once
|
2018-03-23 02:18:13 +00:00
|
|
|
#ifdef _MSC_VER
|
2013-11-24 05:32:19 +00:00
|
|
|
#include "SDL/SDL.h"
|
|
|
|
#include "SDL/SDL_thread.h"
|
|
|
|
#else
|
2013-11-05 12:49:23 +00:00
|
|
|
#include "SDL.h"
|
|
|
|
#include "SDL_thread.h"
|
2013-11-24 05:32:19 +00:00
|
|
|
#endif
|
2013-11-05 12:49:23 +00:00
|
|
|
|
2020-10-01 07:36:43 +00:00
|
|
|
#include "Common/Input/InputState.h"
|
|
|
|
#include "Common/Input/KeyCodes.h"
|
2020-10-04 18:48:47 +00:00
|
|
|
#include "Common/Net/Resolve.h"
|
2013-11-05 12:49:23 +00:00
|
|
|
|
|
|
|
class SDLJoystick{
|
|
|
|
public:
|
|
|
|
SDLJoystick(bool init_SDL = false);
|
|
|
|
~SDLJoystick();
|
|
|
|
|
2017-02-01 06:19:18 +00:00
|
|
|
void registerEventHandler();
|
2013-11-05 12:49:23 +00:00
|
|
|
void ProcessInput(SDL_Event &event);
|
|
|
|
|
|
|
|
private:
|
2016-09-19 23:28:28 +00:00
|
|
|
void setUpController(int deviceIndex);
|
|
|
|
void setUpControllers();
|
2016-09-18 22:23:36 +00:00
|
|
|
keycode_t getKeycodeForButton(SDL_GameControllerButton button);
|
|
|
|
int getDeviceIndex(int instanceId);
|
2017-02-01 06:19:18 +00:00
|
|
|
bool registeredAsEventHandler;
|
2016-09-19 23:28:28 +00:00
|
|
|
std::vector<SDL_GameController *> controllers;
|
|
|
|
std::map<int, int> controllerDeviceMap;
|
2013-11-05 12:49:23 +00:00
|
|
|
};
|