Ejemplo n.º 1
0
static void queueButtonEvent(struct Gamepad_device * device, double timestamp, unsigned int buttonID, bool down) {
  struct Gamepad_buttonEvent * buttonEvent;
	
  buttonEvent = malloc(sizeof(struct Gamepad_buttonEvent));
  buttonEvent->device = device;
  buttonEvent->timestamp = timestamp;
  buttonEvent->buttonID = buttonID;
  buttonEvent->down = down;
	
  queueInputEvent(device->deviceID, down ? GAMEPAD_EVENT_BUTTON_DOWN : GAMEPAD_EVENT_BUTTON_UP, buttonEvent);
}
Ejemplo n.º 2
0
static void queueAxisEvent(struct Gamepad_device * device, double timestamp, unsigned int axisID, float value) {
	struct Gamepad_axisEvent * axisEvent;
	
	axisEvent = malloc(sizeof(struct Gamepad_axisEvent));
	axisEvent->device = device;
	axisEvent->timestamp = timestamp;
	axisEvent->axisID = axisID;
	axisEvent->value = value;
	
	queueInputEvent(device->eventDispatcher, GAMEPAD_EVENT_AXIS_MOVED, axisEvent);
}