Changeset 4363 in orxonox.OLD for orxonox/trunk
- Timestamp:
- May 28, 2005, 3:06:47 PM (20 years ago)
- Location:
- orxonox/trunk/src/util/event
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/event/event_def.h
r4353 r4363 8 8 #define _EVENT_DEF_H 9 9 10 #include "SDL_keysym.h" 11 10 12 #define CMD_LENGHT 16 13 14 typedef 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 }; 11 23 12 24 -
orxonox/trunk/src/util/event/event_handler.cc
r4362 r4363 12 12 main-programmer: Patrick Boenzli 13 13 co-programmer: 14 15 This code is inspired by Christian Meyers CommandNode code (in Orxonox v0.2.3) 14 16 */ 15 17 … … 23 25 #include "keynames.h" 24 26 25 #include "SDL_keysym.h"26 27 27 28 using namespace std; … … 230 231 break; 231 232 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; 240 239 break; 241 240 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; 247 243 break; 248 244 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; 254 247 break; 255 248 case SDL_JOYAXISMOTION: 249 ev.bPressed = false; 250 ev.type = EV_JOY_AXIS_MOTION; 251 break; 256 252 case SDL_JOYBALLMOTION: 253 ev.bPressed = false; 254 ev.type = EV_JOY_BALL_MOTION; 255 break; 257 256 case SDL_JOYHATMOTION: 257 ev.bPressed = false; 258 ev.type = EV_JOY_HAT_MOTION; 259 break; 258 260 case SDL_JOYBUTTONDOWN: 261 ev.bPressed = true; 262 ev.type = EV_JOY_BUTTON; 263 break; 259 264 case SDL_JOYBUTTONUP: 265 ev.bPressed = true; 266 ev.type = EV_JOY_BUTTON; 260 267 break; 261 268 default:
Note: See TracChangeset
for help on using the changeset viewer.