Ejemplo n.º 1
0
static void loop_device(int fd)
{
	struct MTouch mt;
	if (mtouch_configure(&mt, fd)) {
		fprintf(stderr, "error: could not configure device\n");
		return;
	}
	if (mtouch_open(&mt, fd)) {
		fprintf(stderr, "error: could not open device\n");
		return;
	}

	mconfig_defaults(&mt.cfg);
	printf("width:  %d\n", mt.hs.max_x);
	printf("height: %d\n", mt.hs.max_y);

	//while (!mtdev_idle(&mt.dev, fd, 5000)) {
	while (1) {
		while (mtouch_read(&mt) > 0)
			print_gestures(&mt.gs);
		if (mtouch_delayed(&mt))
			print_gestures(&mt.gs);
	}
	mtouch_close(&mt);
}
Ejemplo n.º 2
0
static int device_off(LocalDevicePtr local)
{
	struct MTouch *mt = local->private;
	xf86RemoveEnabledDevice(local);
	if (mtouch_close(mt))
		xf86Msg(X_WARNING, "mtrack: cannot ungrab device\n");
	xf86CloseSerial(local->fd);
	return Success;
}
Ejemplo n.º 3
0
static int device_off(InputInfoPtr local)
{
	struct mtev_mtouch *mt = local->private;
	xf86RemoveEnabledDevice(local);
	if(mtouch_close(mt, local->fd)) {
		xf86Msg(X_WARNING, "mtev: cannot ungrab device\n");
	}
	xf86CloseSerial(local->fd);
	return Success;
}
Ejemplo n.º 4
0
static int device_off(LocalDevicePtr local)
{
	struct MTouch *mt = local->private;
	xf86RemoveEnabledDevice(local);
	if (mtouch_close(mt))
		xf86Msg(X_WARNING, "mtrack: cannot ungrab device\n");
	xf86CloseSerial(local->fd);
	if(mt->timer != NULL)
		TimerFree(mt->timer);	// release any existing timer
	mt->timer = NULL;
	mt->is_timer_installed = 0;
	return Success;
}