2012-07-20 01:08:29 +00:00
|
|
|
#ifndef _INPUTMANAGER_H_
|
|
|
|
#define _INPUTMANAGER_H_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <SDL/SDL.h>
|
2012-07-22 21:15:55 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2012-07-20 01:08:29 +00:00
|
|
|
|
|
|
|
class GuiComponent;
|
|
|
|
|
|
|
|
namespace InputManager {
|
|
|
|
void registerComponent(GuiComponent* comp);
|
|
|
|
void unregisterComponent(GuiComponent* comp);
|
|
|
|
|
2012-07-22 21:15:55 +00:00
|
|
|
void loadConfig(std::string path);
|
2012-07-20 01:08:29 +00:00
|
|
|
|
2012-07-22 21:15:55 +00:00
|
|
|
//enum for identifying input, regardless of configuration
|
2012-07-23 17:27:38 +00:00
|
|
|
enum InputButton { UNKNOWN, UP, DOWN, LEFT, RIGHT, BUTTON1, BUTTON2 };
|
2012-07-20 01:08:29 +00:00
|
|
|
|
|
|
|
void processEvent(SDL_Event* event);
|
|
|
|
|
|
|
|
extern std::vector<GuiComponent*> inputVector;
|
2012-07-22 21:15:55 +00:00
|
|
|
extern SDL_Event* lastEvent; //mostly for GuiInputConfig
|
2012-07-22 22:03:54 +00:00
|
|
|
extern int deadzone;
|
2012-07-22 21:15:55 +00:00
|
|
|
|
|
|
|
extern std::map<int, InputButton> joystickButtonMap;
|
2012-07-23 17:27:38 +00:00
|
|
|
extern std::map<int, InputButton> joystickAxisPosMap, joystickAxisNegMap;
|
|
|
|
extern std::map<int, int> axisState;
|
2012-07-20 01:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|