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"
|
2023-04-24 12:44:07 +00:00
|
|
|
#else
|
|
|
|
#if PPSSPP_PLATFORM(MAC)
|
|
|
|
#include "SDL2/SDL.h"
|
2013-11-24 05:32:19 +00:00
|
|
|
#else
|
2013-11-05 12:49:23 +00:00
|
|
|
#include "SDL.h"
|
2023-04-24 12:44:07 +00:00
|
|
|
#endif
|
2013-11-24 05:32:19 +00:00
|
|
|
#endif
|
2022-01-30 23:49:02 +00:00
|
|
|
#include <map>
|
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();
|
2023-05-26 16:40:13 +00:00
|
|
|
InputKeyCode getKeycodeForButton(SDL_GameControllerButton button);
|
2016-09-18 22:23:36 +00:00
|
|
|
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
|
|
|
};
|