virtual bool CheckEvent(SDL_Event * event) {
#if OLD_JOYSTICK
		SDL_JoyAxisEvent * jaxis = NULL;
		SDL_JoyButtonEvent * jbutton = NULL;

	switch(event->type) {
		case SDL_JOYAXISMOTION:
			jaxis = &event->jaxis;
			if(jaxis->which == stick)
			        if(jaxis->axis == 0)
					JOYSTICK_Move_X(emustick,(float)(jaxis->value/32768.0));
				else if(jaxis->axis == 1)
					JOYSTICK_Move_Y(emustick,(float)(jaxis->value/32768.0));
			break;
		case SDL_JOYBUTTONDOWN:
		case SDL_JOYBUTTONUP:
			jbutton = &event->jbutton;
			bool state;
			state=jbutton->type==SDL_JOYBUTTONDOWN;
			if ((jbutton->which == stick) && (jbutton->button<2)) {
				JOYSTICK_Button(emustick,jbutton->button,state);
			}
			break;
	}
#endif
		return false;
	}
Esempio n. 2
0
 void release() const { JOYSTICK_Button(dosboxPort, dosboxID & 1, false); }
Esempio n. 3
0
 void press() const   { JOYSTICK_Button(dosboxPort, dosboxID & 1, true);  }