more event plugin code

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1717 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee
2008-12-29 20:12:19 +00:00
parent e2bd162d1d
commit c20a54d65d
10 changed files with 152 additions and 432 deletions

View File

@@ -4,6 +4,20 @@
#include "Event.hpp"
typedef bool (*listenFuncPtr) (sf::Event *);
enum InputType
{
KeyboardInput,
MouseInput,
JoystickInput
};
struct Keys
{
InputType inputType;
sf::Event::EventType eventType;
sf::Key::Code keyCode;
sf::Mouse::Button mouseButton;
};
class EventHandler {
@@ -11,12 +25,14 @@ private:
listenFuncPtr keys[100][6];
listenFuncPtr mouse[6];
listenFuncPtr joys[10];
std::queue<sf::Event> eventQueue;
std::queue<Keys> eventQueue;
public:
bool RegisterEventListener(listenFuncPtr func, int event, int type);
void Update();
bool addEvent(sf::Event *);
static bool TestEvent (Keys k, sf::Event e);
static int wxCharCodeWXToX(int id);
static void SFKeyToString(unsigned int keycode, char *keyStr);
};
#endif