00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef UIKEYCOMBINATION_H
00023 #define UIKEYCOMBINATION_H
00024
00025 #include <list>
00026 #include "SDL/SDL.h"
00027
00028 #include "basicobject.h"
00029 #include "tinyxml.h"
00030
00053 class DECLSPEC UiKeyCombination
00054 {
00055 public:
00056 DECLSPEC UiKeyCombination();
00057 virtual DECLSPEC ~UiKeyCombination();
00058
00069 DECLSPEC void init( TiXmlElement *el );
00085 DECLSPEC void addCombination( SDLKey k, SDLMod m, BasicObject *aim_p, BasicObject::Callback p, BasicObject *aim_r = NULL, BasicObject::Callback r = NULL );
00093 DECLSPEC bool removeCombination( SDLKey k, SDLMod m );
00098 DECLSPEC void removeAll();
00107 DECLSPEC bool keyPressed( SDLKey k, SDLMod m );
00116 DECLSPEC bool keyReleased( SDLKey k, SDLMod m );
00117
00121 static UiKeyCombination *the;
00129 static DECLSPEC UiKeyCombination *getThe();
00130 private:
00131 struct KeyComb
00132 {
00133 SDLMod mod;
00134 SDLKey key;
00135 BasicObject::FunctionData pressed, released;
00136 };
00137 std::list<KeyComb*> lKeyCombs;
00138 typedef std::list<KeyComb*>::iterator KeyCombIter;
00139 };
00140
00141 #endif