rpms/hal/devel hal-joystick.patch,NONE,1.1 hal.spec,1.165,1.166

Matthew Garrett mjg59 at fedoraproject.org
Tue Oct 21 15:48:14 UTC 2008


Author: mjg59

Update of /cvs/pkgs/rpms/hal/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24474

Modified Files:
	hal.spec 
Added Files:
	hal-joystick.patch 
Log Message:
clog

hal-joystick.patch:

--- NEW FILE hal-joystick.patch ---
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 11f79cd..eff4ee5 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1060,16 +1060,27 @@ input_test_abs (HalDevice *d, const char *sysfs_path)
 			hal_device_add_capability (d, "input.touchpad");
 			goto out;
 		} else {
-			/*
-			 * This path is taken by VMware's USB mouse, which has
-			 * absolute axes, but no touch/pressure button.
-			 */
-			hal_device_add_capability (d, "input.mouse");
-			goto out;
+			long bitmask_button[NBITS(KEY_MAX)];
+
+			s = hal_util_get_string_from_file (sysfs_path, "capabilities/key");
+			if (s == NULL) {
+				hal_device_add_capability (d, "input.joystick");
+				goto out;
+			}
+
+			if (test_bit(BTN_LEFT, bitmask_button)) {
+				/*
+				 * This path is taken by VMware's USB mouse, which has
+				 * absolute axes, but no touch/pressure button.
+				 */
+				hal_device_add_capability (d, "input.mouse");
+				goto out;
+			}
+
+			hal_device_add_capability (d, "input.joystick");
 		}
         }
 
-        /* TODO: Hmm; this code looks sketchy... why do we do !test_bit on the Y axis ?? */
 	if (test_bit(ABS_X, bitmask) && !test_bit(ABS_Y, bitmask)) {
 		long bitmask_touch[NBITS(KEY_MAX)];
 
@@ -1084,6 +1095,9 @@ input_test_abs (HalDevice *d, const char *sysfs_path)
 			hal_device_add_capability (d, "input.tablet");
                 }
 	}
+
+	if (test_bit(ABS_WHEEL, bitmask) || test_bit(ABS_THROTTLE, bitmask))
+		hal_device_add_capability (d, "input.joystick");
 out:
 	;
 }


Index: hal.spec
===================================================================
RCS file: /cvs/pkgs/rpms/hal/devel/hal.spec,v
retrieving revision 1.165
retrieving revision 1.166
diff -u -r1.165 -r1.166
--- hal.spec	20 Oct 2008 15:31:52 -0000	1.165
+++ hal.spec	21 Oct 2008 15:47:43 -0000	1.166
@@ -28,13 +28,14 @@
 Name: hal
 Version: 0.5.12
 #Release: 5%{?dist}
-Release: 4.%{?alphatag}%{?dist}
+Release: 5.%{?alphatag}%{?dist}
 URL: http://www.freedesktop.org/Software/hal
 #Source0: http://hal.freedesktop.org/releases/%{name}-%{version}.tar.gz
 Source0: http://hal.freedesktop.org/releases/%{name}-%{version}-%{?alphatag}.tar.gz
 Patch1: hal-0.5.10-set-property-direct.patch
 Patch2: hal-change-priority.patch
 Patch3: hal-add-keys-to-buttons.patch
+Patch4: hal-joystick.patch
 
 License: AFL or GPLv2
 Group: System Environment/Libraries
@@ -132,6 +133,7 @@
 %patch1 -p1 -b .direct
 %patch2 -p1 -b .priority
 %patch3 -p1 -b .keys
+%patch4 -p1 -b .joystick
 
 %build
 autoreconf
@@ -276,6 +278,9 @@
 %{_datadir}/gtk-doc/html/libhal-storage/*
 
 %changelog
+* Tue Oct 21 2008 Matthew Garrett <mjg at redhat.com> - 0.5.12-5.20081013git
+- Fix input.joystick handling
+
 * Mon Oct 20 2008 Matthew Garrett <mjg at redhat.com> - 0.5.12-4.20081013git
 - Add input.keys capability to appropriate button devices
 




More information about the scm-commits mailing list