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
|
|
|
|
enum InputButton { UP, DOWN, LEFT, RIGHT, BUTTON1, BUTTON2, UNKNOWN};
|
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
|
|
|
|
|
|
|
|
extern std::map<int, InputButton> joystickButtonMap;
|
|
|
|
extern std::map<int, InputButton> joystickAxisMap;
|
2012-07-20 01:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|