aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits
diff options
context:
space:
mode:
authorrene <rene@FreeBSD.org>2014-07-21 21:23:26 +0800
committerrene <rene@FreeBSD.org>2014-07-21 21:23:26 +0800
commit1fb0c48a3d5e6e9ef8862917e4350098d0961814 (patch)
treef686a1c06b13ed0d6b96a3e3aaa010933076f8f6 /x11-toolkits
parent9cb15fba4b4c6db6cc206af2beb32db3f7a42a25 (diff)
downloadfreebsd-ports-gnome-1fb0c48a3d5e6e9ef8862917e4350098d0961814.tar.gz
freebsd-ports-gnome-1fb0c48a3d5e6e9ef8862917e4350098d0961814.tar.zst
freebsd-ports-gnome-1fb0c48a3d5e6e9ef8862917e4350098d0961814.zip
- Fix min/max/center values of USB joysticks
- Bump PORTREVISION PR: 189006 Submitted by: russo@bogodyn.org
Diffstat (limited to 'x11-toolkits')
-rw-r--r--x11-toolkits/plib/Makefile2
-rw-r--r--x11-toolkits/plib/files/patch-src__js__jsBSD.cxx47
2 files changed, 48 insertions, 1 deletions
diff --git a/x11-toolkits/plib/Makefile b/x11-toolkits/plib/Makefile
index cf1f52782bac..e93f0bf50a20 100644
--- a/x11-toolkits/plib/Makefile
+++ b/x11-toolkits/plib/Makefile
@@ -3,7 +3,7 @@
PORTNAME= plib
PORTVERSION= 1.8.5
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= x11-toolkits
MASTER_SITES= http://plib.sourceforge.net/dist/
diff --git a/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx b/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx
new file mode 100644
index 000000000000..6f0b6b797f69
--- /dev/null
+++ b/x11-toolkits/plib/files/patch-src__js__jsBSD.cxx
@@ -0,0 +1,47 @@
+--- ./src/js/jsBSD.cxx.orig 2014-07-21 15:11:30.000000000 +0200
++++ ./src/js/jsBSD.cxx 2014-07-21 15:11:30.000000000 +0200
+@@ -99,6 +99,8 @@
+ // on every read of a USB device
+ int cache_buttons ;
+ float cache_axes [ _JS_MAX_AXES ] ;
++ float axes_minimum [ _JS_MAX_AXES ] ;
++ float axes_maximum [ _JS_MAX_AXES ] ;
+ };
+
+ // Idents lower than USB_IDENT_OFFSET are for analog joysticks.
+@@ -196,9 +198,12 @@
+ case HUG_Z:
+ case HUG_RZ:
+ case HUG_SLIDER:
++ case HUG_DIAL:
+ if (*num_axes < _JS_MAX_AXES)
+ {
+ os->axes_usage[*num_axes] = usage;
++ os->axes_minimum[*num_axes] = h.logical_minimum;
++ os->axes_maximum[*num_axes] = h.logical_maximum;
+ (*num_axes)++;
+ }
+ break;
+@@ -324,9 +329,6 @@
+
+ for ( int i = 0 ; i < _JS_MAX_AXES ; i++ )
+ {
+- // We really should get this from the HID, but that data seems
+- // to be quite unreliable for analog-to-USB converters. Punt for
+- // now.
+ if ( os->axes_usage [ i ] == HUG_HAT_SWITCH )
+ {
+ max [ i ] = 1.0f ;
+@@ -335,9 +337,9 @@
+ }
+ else
+ {
+- max [ i ] = 255.0f ;
+- center [ i ] = 127.0f ;
+- min [ i ] = 0.0f ;
++ max [ i ] = os->axes_maximum [ i ];
++ min [ i ] = os->axes_minimum [ i ];
++ center [ i ] = (max [ i ] + min [ i ]) / 2.0 ;
+ }
+ dead_band [ i ] = 0.0f ;
+ saturate [ i ] = 1.0f ;