summaryrefslogtreecommitdiff
path: root/user/plib/joystick.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-10-24 05:56:34 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-10-24 05:56:34 +0000
commit9474d725ce5d4963229a5223e5c3eec9d4a4052a (patch)
tree930ca12fa18ccd9fc93217138afc9d322585addb /user/plib/joystick.patch
parent6fb1b6516a1493d708b0cbad120d6a2bf1251b05 (diff)
downloadpackages-9474d725ce5d4963229a5223e5c3eec9d4a4052a.tar.gz
packages-9474d725ce5d4963229a5223e5c3eec9d4a4052a.tar.bz2
packages-9474d725ce5d4963229a5223e5c3eec9d4a4052a.tar.xz
packages-9474d725ce5d4963229a5223e5c3eec9d4a4052a.zip
user/plib: thanks, Debian
Diffstat (limited to 'user/plib/joystick.patch')
-rw-r--r--user/plib/joystick.patch31
1 files changed, 31 insertions, 0 deletions
diff --git a/user/plib/joystick.patch b/user/plib/joystick.patch
new file mode 100644
index 000000000..febcc89e3
--- /dev/null
+++ b/user/plib/joystick.patch
@@ -0,0 +1,31 @@
+Description: Don't break system calibration settings when a joystick is opened
+ plib may do additional dead-band management on top of the OS joystick driver,
+ it should not break system settings for that reason!
+Author: Florent Rougon <f.rougon@free.fr>
+Bug: https://sourceforge.net/p/plib/bugs/47/
+Bug-Debian: http://bugs.debian.org/787464
+Last-Update: 2015-06-01
+
+--- a/src/js/jsLinux.cxx
++++ b/src/js/jsLinux.cxx
+@@ -79,20 +79,6 @@
+ if ( num_axes > _JS_MAX_AXES )
+ num_axes = _JS_MAX_AXES ;
+
+- // Remove any deadband value already done in the kernel.
+- // Since we have our own deadband management this is save to do so.
+- struct js_corr* corr = new js_corr[ all_axes ] ;
+- ioctl ( os->fd, JSIOCGCORR, corr );
+- for ( int i = 0; i < num_axes ; ++i ) {
+- if ( corr[ i ] . type == JS_CORR_BROKEN ) {
+- int nodeadband = ( corr[ i ] . coef[ 0 ] + corr[ i ] . coef[ 1 ] ) / 2 ;
+- corr[ i ] . coef[ 0 ] = nodeadband ;
+- corr[ i ] . coef[ 1 ] = nodeadband ;
+- }
+- }
+- ioctl ( os->fd, JSIOCSCORR, corr );
+- delete [] corr;
+-
+ for ( int i = 0 ; i < _JS_MAX_AXES ; i++ )
+ {
+ max [ i ] = 32767.0f ;