hal/hald/linux2/probing probe-input.c,1.7,1.8

Danny Kukawka dkukawka at freedesktop.org
Tue Aug 23 01:26:17 PDT 2005


Update of /cvs/hal/hal/hald/linux2/probing
In directory gabe:/tmp/cvs-serv31241/hald/linux2/probing

Modified Files:
	probe-input.c 
Log Message:
2005-08-23  Danny Kukawka <danny.kukawka at web.de>

        * hald/linux2/probing/probe-input.c: (check_abs): Fixed detection of
        input capability for joysticks (input.joystick).



Index: probe-input.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/probing/probe-input.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- probe-input.c	29 Jul 2005 20:32:57 -0000	1.7
+++ probe-input.c	23 Aug 2005 08:26:14 -0000	1.8
@@ -44,6 +44,7 @@
 check_abs (int fd, LibHalContext *ctx, const char *udi)
 {
 	char bitmask[(ABS_MAX + 7) / 8];
+	char bitmask_touch[(KEY_MAX + 7) / 8];
 	DBusError error;
 
 	if (ioctl (fd, EVIOCGBIT(EV_ABS, sizeof (bitmask)), bitmask) < 0) {
@@ -51,13 +52,22 @@
 		goto out;
 	}
 
+	if (ioctl (fd, EVIOCGBIT(EV_KEY, sizeof (bitmask_touch)), bitmask_touch) < 0) {
+		fprintf(stderr, "ioctl EVIOCGBIT failed\n");
+		goto out;
+	}
+	
 	if (!test_bit(ABS_X, bitmask) || !test_bit(ABS_Y, bitmask)) {
 		fprintf (stderr, "missing x or y absolute axes\n");
 		goto out;
 	}
 
 	dbus_error_init (&error);
-	libhal_device_add_capability (ctx, udi, "input.tablet", &error);
+	if (test_bit(BTN_TOUCH, bitmask_touch) != 0) {
+		libhal_device_add_capability (ctx, udi, "input.tablet", &error);
+		goto out;
+	}
+	libhal_device_add_capability (ctx, udi, "input.joystick", &error);
 
 out:
 	;




More information about the hal-commit mailing list