mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-23 21:39:52 +00:00
2675d6ea43
* Switch deviceID from int to enum InputDeviceID, globally * Switch axisId to enum InputAxis * Change int keycodes to InputKeyCode where it makes sense. * SDL input buildfix * SDL keycode buildfix * Switch on enum warning fixes * Qt keycode buildfix * iOS keycode buildfix * UWP keycode buildfix * More iOS buildfix * More iOS buildfix * Update DinputDevice.cpp
34 lines
716 B
C++
34 lines
716 B
C++
#pragma once
|
|
#ifdef _MSC_VER
|
|
#include "SDL/SDL.h"
|
|
#else
|
|
#if PPSSPP_PLATFORM(MAC)
|
|
#include "SDL2/SDL.h"
|
|
#else
|
|
#include "SDL.h"
|
|
#endif
|
|
#endif
|
|
#include <map>
|
|
|
|
#include "Common/Input/InputState.h"
|
|
#include "Common/Input/KeyCodes.h"
|
|
#include "Common/Net/Resolve.h"
|
|
|
|
class SDLJoystick{
|
|
public:
|
|
SDLJoystick(bool init_SDL = false);
|
|
~SDLJoystick();
|
|
|
|
void registerEventHandler();
|
|
void ProcessInput(SDL_Event &event);
|
|
|
|
private:
|
|
void setUpController(int deviceIndex);
|
|
void setUpControllers();
|
|
InputKeyCode getKeycodeForButton(SDL_GameControllerButton button);
|
|
int getDeviceIndex(int instanceId);
|
|
bool registeredAsEventHandler;
|
|
std::vector<SDL_GameController *> controllers;
|
|
std::map<int, int> controllerDeviceMap;
|
|
};
|