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