Changeset 5786 in orxonox.OLD for trunk/src/lib/event
- Timestamp:
- Nov 26, 2005, 9:56:11 PM (19 years ago)
- Location:
- trunk/src/lib/event
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/event/Makefile.am
r5463 r5786 4 4 noinst_LIBRARIES = libORXevent.a 5 5 6 libORXevent_a_SOURCES = event.cc \ 7 event_handler.cc \ 6 libORXevent_a_SOURCES = event_handler.cc \ 8 7 event_listener.cc \ 9 8 key_mapper.cc \ -
trunk/src/lib/event/event.h
r5391 r5786 27 27 28 28 //! An abstract event class 29 class Event { 30 31 public: 32 Event(); 33 34 int offset; //!< offset in the event type array 29 struct Event { 35 30 int type; //!< the type field 36 31 bool bPressed; //!< is true, if the button/mouse was pressed, false if released -
trunk/src/lib/event/event_handler.cc
r5553 r5786 46 46 /* now initialize them all to zero */ 47 47 this->flush(ES_ALL); 48 this->withUNICODE(false); 48 49 49 50 this->state = ES_GAME; 50 51 this->keyMapper = NULL; 51 52 this->stateStack = NULL; 53 52 54 } 53 55 … … 247 249 248 250 251 void EventHandler::withUNICODE(bool enableUNICODE) 252 { 253 SDL_EnableUNICODE(enableUNICODE); 254 this->bUNICODE = enableUNICODE; 255 } 256 257 249 258 /** 250 259 * core function of event handler: receives all events from SDL … … 264 273 ev.bPressed = true; 265 274 ev.type = event.key.keysym.sym; 275 if (unlikely(this->bUNICODE)) 276 ev.x = event.key.keysym.unicode; 266 277 break; 267 278 case SDL_KEYUP: 268 279 ev.bPressed = false; 269 280 ev.type = event.key.keysym.sym; 281 if (unlikely(this->bUNICODE)) 282 ev.x = event.key.keysym.unicode; 270 283 break; 271 284 case SDL_MOUSEMOTION: -
trunk/src/lib/event/event_handler.h
r5776 r5786 41 41 inline bool isSubscribed(elState state, int eventType) { return(listeners[state][eventType] == NULL)?false:true; }; 42 42 43 44 void withUNICODE(bool enableUNICODE); 45 43 46 void process(); 44 47 … … 58 61 KeyMapper* keyMapper; //!< reference to the key mapper. 59 62 63 bool bUNICODE; //!< If unicode should be enabled. 60 64 }; 61 65
Note: See TracChangeset
for help on using the changeset viewer.