Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4406 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 30, 2005, 7:01:24 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: the mouse buttons now should be identified correctly

Location:
orxonox/trunk/src/util/event
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/event/event_def.h

    r4387 r4406  
    1919#define EVENT_QUEUE_LENGTH 32
    2020
     21
    2122typedef enum extEventTyes
    2223  {
    23     EV_MOUSE_MOTION = SDLK_LAST,
    24     EV_MOUSE_BUTTON,
     24    EV_MOUSE_BUTTON_LEFT = SDLK_LAST,
     25    EV_MOUSE_BUTTON_MIDDLE,
     26    EV_MOUSE_BUTTON_RIGHT,
     27    EV_MOUSE_BUTTON_WHEELUP,
     28    EV_MOUSE_BUTTON_WHEELDOWN,
     29    EV_MOUSE_MOTION,
    2530    EV_JOY_AXIS_MOTION,
    2631    EV_JOY_BALL_MOTION,
  • orxonox/trunk/src/util/event/event_handler.cc

    r4405 r4406  
    8282void EventHandler::subscribe(EventListener* el, elState state, int eventType)
    8383{
     84  PRINTF(0)("Subscribing event type: %i\n", eventType);
    8485  if( likely(this->listeners[state][eventType] == NULL))
    8586    this->listeners[state][eventType] = el;
     
    9192void EventHandler::unsubscribe(int eventType, elState state)
    9293{
     94  PRINTF(0)("Unsubscribing event type nr: %i\n", eventType);
    9395  this->listeners[state][eventType] = NULL;
    9496}
     
    144146        case SDL_MOUSEBUTTONUP:
    145147          ev.bPressed = false;
    146           ev.type = EV_MOUSE_BUTTON;
     148          ev.type = event.button.button + SDLK_LAST;
    147149          break;
    148150        case SDL_MOUSEBUTTONDOWN:
    149151          ev.bPressed = true;
    150           ev.type = EV_MOUSE_BUTTON;
     152          ev.type = event.button.button + SDLK_LAST;
    151153          break;
    152154        case SDL_JOYAXISMOTION:
Note: See TracChangeset for help on using the changeset viewer.