Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4363 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
May 28, 2005, 3:06:47 PM (19 years ago)
Author:
patrick
Message:

orxonox/trunk: finished work on the event dispatcher, now implementing the event reaction

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

Legend:

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

    r4353 r4363  
    88#define _EVENT_DEF_H
    99
     10#include "SDL_keysym.h"
     11
    1012#define CMD_LENGHT 16
     13
     14typedef enum extEventTyes
     15  {
     16    EV_MOUSE_MOTION = SDLK_LAST,
     17    EV_MOUSE_BUTTON,
     18    EV_JOY_AXIS_MOTION,
     19    EV_JOY_BALL_MOTION,
     20    EV_JOY_HAT_MOTION,
     21    EV_JOY_BUTTON
     22  };
    1123
    1224
  • orxonox/trunk/src/util/event/event_handler.cc

    r4362 r4363  
    1212   main-programmer: Patrick Boenzli
    1313   co-programmer:
     14
     15   This code is inspired by Christian Meyers CommandNode code (in Orxonox v0.2.3)
    1416*/
    1517
     
    2325#include "keynames.h"
    2426
    25 #include "SDL_keysym.h"
    2627
    2728using namespace std;
     
    230231          break;
    231232        case SDL_MOUSEMOTION:
    232           /*
    233           strcpy( cmd.cmd, "cursor");
    234           cmd.x = event.motion.x;
    235           cmd.y = event.motion.y;
    236           cmd.xrel = event.motion.xrel;
    237           cmd.yrel = event.motion.yrel;
    238           if( strlen (cmd.cmd) > 0) relay(&cmd);
    239           */
     233          ev.bPressed = false;
     234          ev.type = EV_MOUSE_MOTION;
     235          ev.x = event.motion.x;
     236          ev.y = event.motion.y;
     237          ev.xRel = event.motion.xrel;
     238          ev.yRel = event.motion.yrel;
    240239          break;
    241240        case SDL_MOUSEBUTTONUP:
    242           /*
    243           strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    244           cmd.bUp = true;
    245           if( strlen (cmd.cmd) > 0) relay(&cmd);
    246           */
     241          ev.bPressed = false;
     242          ev.type = EV_MOUSE_BUTTON;
    247243          break;
    248244        case SDL_MOUSEBUTTONDOWN:
    249           /*
    250           strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    251           cmd.bUp = false;
    252           if( strlen (cmd.cmd) > 0) relay(&cmd);
    253           */
     245          ev.bPressed = true;
     246          ev.type = EV_MOUSE_BUTTON;
    254247          break;
    255248        case SDL_JOYAXISMOTION:
     249          ev.bPressed = false;
     250          ev.type = EV_JOY_AXIS_MOTION;
     251          break;
    256252        case SDL_JOYBALLMOTION:
     253          ev.bPressed = false;
     254          ev.type = EV_JOY_BALL_MOTION;
     255          break;
    257256        case SDL_JOYHATMOTION:
     257          ev.bPressed = false;
     258          ev.type = EV_JOY_HAT_MOTION;
     259          break;
    258260        case SDL_JOYBUTTONDOWN:
     261          ev.bPressed = true;
     262          ev.type = EV_JOY_BUTTON;
     263          break;
    259264        case SDL_JOYBUTTONUP:
     265          ev.bPressed = true;
     266          ev.type = EV_JOY_BUTTON;
    260267          break;
    261268        default:
Note: See TracChangeset for help on using the changeset viewer.