Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8743 in orxonox.OLD for trunk/src/lib/event


Ignore:
Timestamp:
Jun 23, 2006, 3:17:15 PM (19 years ago)
Author:
bensch
Message:

gui: event-handler now supports retrieving key-states

Location:
trunk/src/lib/event
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/event/event_handler.cc

    r8717 r8743  
    4949  this->state = ES_GAME;
    5050  this->eventsGrabbed = false;
     51
     52  this->keyState = SDL_GetKeyState(NULL);
    5153}
    5254
  • trunk/src/lib/event/event_handler.h

    r8623 r8743  
    4242  bool isSubscribed(elState state, int eventType);
    4343
     44  /** @param key the key to check @returns true if key is pressed */
     45  bool isPressed(SDLKey key) const { return this->keyState[key]; };
    4446
    4547  void withUNICODE(elState state, bool enableUNICODE);
     
    7678  bool                         bUNICODE[ES_NUMBER];             //!< If unicode should be enabled.
    7779  bool                         eventsGrabbed;                   //!< If the events should be grabbed
     80
     81  Uint8*                       keyState;
    7882};
    7983
Note: See TracChangeset for help on using the changeset viewer.