mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Merge GCPadNew into Dolphin. This takes place in three segments: Core, InputCommon, and InputUICommon. From now on it can be referred to just as "GCPad".
Switch to Billiard's IniFile implementation throughout Dolphin (it's faster!!). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5579 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,64 +0,0 @@
|
||||
#ifndef EVENTHANDER_H
|
||||
#define EVENTHANDER_H 1
|
||||
#include "Common.h"
|
||||
#include <queue>
|
||||
#include "Event.hpp"
|
||||
|
||||
#define NUMKEYS 300
|
||||
#define NUMMODS 8
|
||||
|
||||
typedef bool (*listenFuncPtr) (sf::Event);
|
||||
enum InputType
|
||||
{
|
||||
KeyboardInput,
|
||||
MouseInput,
|
||||
JoystickInput
|
||||
};
|
||||
|
||||
enum Modifiers {
|
||||
UseAlt = 1,
|
||||
UseShift = 2,
|
||||
UseCtrl = 4
|
||||
};
|
||||
|
||||
struct Keys {
|
||||
InputType inputType;
|
||||
sf::Event::EventType eventType;
|
||||
sf::Key::Code keyCode;
|
||||
int mods;
|
||||
sf::Mouse::Button mouseButton;
|
||||
};
|
||||
|
||||
class EventHandler {
|
||||
|
||||
private:
|
||||
listenFuncPtr keys[NUMKEYS][NUMMODS];
|
||||
listenFuncPtr mouse[sf::Mouse::Count+1];
|
||||
listenFuncPtr joys[sf::Joy::Count+1];
|
||||
std::queue<sf::Event> eventQueue;
|
||||
static EventHandler *m_Instance;
|
||||
|
||||
protected:
|
||||
EventHandler(const EventHandler&);
|
||||
EventHandler& operator= (const EventHandler&);
|
||||
|
||||
EventHandler();
|
||||
~EventHandler();
|
||||
|
||||
public:
|
||||
|
||||
bool RegisterEventListener(listenFuncPtr func, Keys key);
|
||||
bool RemoveEventListener(Keys key);
|
||||
void Update();
|
||||
static EventHandler *GetInstance();
|
||||
static void Init();
|
||||
static void Shutdown();
|
||||
bool addEvent(sf::Event *e);
|
||||
static bool TestEvent (Keys k, sf::Event e);
|
||||
#if defined HAVE_WX && HAVE_WX
|
||||
static sf::Key::Code wxCharCodeToSF(int id);
|
||||
#endif
|
||||
static void SFKeyToString(sf::Key::Code keycode, char *keyStr);
|
||||
};
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user