[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-input-joystick: Changes to 'debian-unstable'



 ChangeLog                   |  168 ++++++++++++++++++++++++++++++++++++++++++++
 config/50-joystick-all.conf |    7 +
 configure.ac                |    8 +-
 debian/changelog            |    9 ++
 debian/control              |    4 -
 man/joystick.man            |  153 +++++++++++++++++++++++++---------------
 src/Makefile.am             |    2 
 src/backend_evdev.c         |   36 +++++++--
 src/jstk.c                  |    4 -
 src/jstk_axis.c             |   57 ++++++++++++++
 src/jstk_properties.c       |    6 -
 11 files changed, 377 insertions(+), 77 deletions(-)

New commits:
commit 17542d5523b284df0cbfb97b9f1a62c2e40ce5af
Author: Michele Cane <michele.cane@gmail.com>
Date:   Wed Jul 17 15:03:39 2013 +0200

    Build against Xserver 1.14.

diff --git a/debian/changelog b/debian/changelog
index 2cf1b41..d70d91a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ xserver-xorg-input-joystick (1:1.6.2-1) UNRELEASED; urgency=low
   * New upstream release.
   * Update dependencies.
   * Bump Standards-Version to 3.9.4, no changes needed.
+  * Build against Xserver 1.14.
 
  -- Michele Cane <michele.cane@gmail.com>  Thu, 11 Jul 2013 09:17:46 +0200
 
diff --git a/debian/control b/debian/control
index f77f7cc..eaa6964 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
  quilt,
  pkg-config,
  xutils-dev,
- xserver-xorg-dev (>= 2:1.9.99.2),
+ xserver-xorg-dev (>= 2:1.14),
  x11proto-input-dev,
  x11proto-core-dev,
  x11proto-randr-dev,

commit 08ba6478a987143aa25a68260ff5f9d22914876c
Author: Michele Cane <michele.cane@gmail.com>
Date:   Wed Jul 17 10:31:25 2013 +0200

    Bump Standards-Version to 3.9.4, no changes needed.

diff --git a/debian/changelog b/debian/changelog
index cb43009..2cf1b41 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,6 +2,7 @@ xserver-xorg-input-joystick (1:1.6.2-1) UNRELEASED; urgency=low
 
   * New upstream release.
   * Update dependencies.
+  * Bump Standards-Version to 3.9.4, no changes needed.
 
  -- Michele Cane <michele.cane@gmail.com>  Thu, 11 Jul 2013 09:17:46 +0200
 
diff --git a/debian/control b/debian/control
index 2e03c2c..f77f7cc 100644
--- a/debian/control
+++ b/debian/control
@@ -15,7 +15,7 @@ Build-Depends:
  x11proto-randr-dev,
  x11proto-kb-dev,
  libusbhid-dev [kfreebsd-any],
-Standards-Version: 3.9.2
+Standards-Version: 3.9.4
 Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-input-joystick
 Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-input-joystick.git
 

commit 33dbd746a572a306fc74a1fdba9d7af4990a10c0
Author: Michele Cane <michele.cane@gmail.com>
Date:   Wed Jul 17 10:29:02 2013 +0200

    debian/control: update dependencies

diff --git a/debian/changelog b/debian/changelog
index 8765088..cb43009 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 xserver-xorg-input-joystick (1:1.6.2-1) UNRELEASED; urgency=low
 
   * New upstream release.
+  * Update dependencies.
 
  -- Michele Cane <michele.cane@gmail.com>  Thu, 11 Jul 2013 09:17:46 +0200
 
diff --git a/debian/control b/debian/control
index 2746c2d..2e03c2c 100644
--- a/debian/control
+++ b/debian/control
@@ -9,7 +9,7 @@ Build-Depends:
  quilt,
  pkg-config,
  xutils-dev,
- xserver-xorg-dev (>= 2:1.9.4),
+ xserver-xorg-dev (>= 2:1.9.99.2),
  x11proto-input-dev,
  x11proto-core-dev,
  x11proto-randr-dev,

commit a70068188857b986a218ea8f4eee6f05a9807dec
Author: Michele Cane <michele.cane@gmail.com>
Date:   Thu Jul 11 09:22:16 2013 +0200

    Bump changelogs.

diff --git a/ChangeLog b/ChangeLog
index 9270178..7a98074 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,171 @@
+commit 426c3aa3c8a2385f17e37ae73c1e78f072656027
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Jan 16 10:52:12 2013 +0100
+
+    joystick 1.6.2
+    
+    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+
+commit 8f9342484afbbd26296c627497cc278f600098ac
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Jan 16 11:06:39 2013 +0100
+
+    config: warning in default xorg.conf.d snippet: do not enable by default
+    
+    see discussion: https://bugs.gentoo.org/show_bug.cgi?id=403003
+    
+    distributions should not ship the module enabled by default, because a lot
+    of users have the joystick module installed without knowing, resulting in
+    confusion and bad user experience when trying to play games, the more
+    likely usecase when plugging in a joystick.
+    
+    the default configuration only fits for a limited number of users.
+    
+    it does not make much sense to automatically enable hotplugging of the
+    module without explicit user consent and reviewing of the configuration.
+    
+    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+
+commit 819ba33c9d7440cd40e1e54a9b1e073ed89353a7
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Sat Oct 6 18:28:53 2012 +0200
+
+    jast_axis: tune accelerated axis transformation to better work with circular axis fields
+    
+    reference: https://bugs.freedesktop.org/show_bug.cgi?id=42399
+    
+    joysticks with a rectangular field have a
+    corner position of (32768,32768), joysticks with a
+    circular field have (23170,23170).
+    
+    make sure that diagonal movement feels fast. either:
+    1) linear
+    
+      f(32768) ~= f(23170) + f(23170)
+      f(32768) ~= a * f(23170)
+             a  = 2.0
+    
+      on circular joysticks, the time needed for xy movement is
+      exactly the time needed for x + the time for y separately.
+      absolute diagonal travel speed (in cm/s) is 0.707 times as fast,
+      which feels pretty slow.
+    
+      on square joysticks, diagonal travel speed is always 1.41 times
+      faster than orthogonal travel speed. time needed for diagonal
+      movement is always 0.5 times as long as for orthogonal movement.
+    
+      the value of a = 2.0 results in a nice, non-linear acceleration.
+    
+    or
+    2) trigonometric
+    
+      f(32768) ~= sqrt(f(23170)^2 + f(23170)^2))
+      f(32768) ~= a * f(23170)
+      a = 1.414
+    
+    on circular joysticks, the absolute pointer travel speed
+    (in cm/s) is now the same for both linear and diagonal movement,
+    which feels natural. moving diagonally takes 0.707 times the time
+    of moving orthogonally.
+    
+    on square joysticks, values are as in 1)
+    
+    the value of a = 1.414 results in linear acceleration, which feels
+    too slow.
+    
+    to maintain non-linear acceleration, make sure that:
+    
+    a >>= 1.414
+    
+    the following formula achieves results inbetween,
+    so it should feel natural on both devices while maintaining a
+    nice acceleration:
+    
+    f(32768) ~= 1.620 * f(23170)
+
+commit 342057bf38e2da46609ed2fa0d3f5fb46c8ed215
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Sat Oct 6 16:18:24 2012 +0200
+
+    backend_evdev: fix scaling overflow for high resolution axes
+    
+    The module scales all axis values from the kernel to the range of
+    -32768 .. 32768, for compatibility with the old joystick kernel module.
+    
+    The current implementation had an integer overflow, if the axis had a high
+    resolution of > 16384, like the popular XBox 360 controller.
+    
+    This commitmakes the scaling use float instead to fix erratic behaviour
+    on high resolution joysticks. The joystick backend was not affected.
+    
+    Fixes bug: https://bugs.freedesktop.org/show_bug.cgi?id=42399
+
+commit 053405f711512959e95d0a882d69b6cba6405e7d
+Author: Gaetan Nadon <memsize@videotron.ca>
+Date:   Sun Jan 13 10:56:53 2013 -0500
+
+    Replace deprecated Automake INCLUDES variable with AM_CPPFLAGS
+    
+    Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html
+    
+      - Support for the long-deprecated INCLUDES variable will be removed
+        altogether in Automake 1.14.  The AM_CPPFLAGS variable should be
+        used instead.
+    
+    This variable was deprecated in Automake releases prior to 1.10, which is the
+    current minimum level required to build X.
+    
+    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+
+commit baa96c22e74b5f617b64d9f5ae21c52a4c4fa190
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Oct 3 18:53:00 2012 +0200
+
+    configure: enable debug output code by default
+    
+    there are rare cases when disabling debug code gives any benefit but the lack of debugging output,
+    which needs to be enabled anyway with the DebugLevel option
+
+commit b427ad6066e966f63a0da82e4b0ef3344064f6a1
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Oct 3 18:44:58 2012 +0200
+
+    man: more manpage tuning and polishing
+
+commit 4b0ca090b71e70cc2b5bcd93ed40fc8c40c499fa
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Oct 3 18:44:06 2012 +0200
+
+    config: mention floating option in xorg.conf.d snippet
+
+commit c473c8bd7985441d8264f8f48537d39dbe0c874e
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Oct 3 17:39:55 2012 +0200
+
+    man: mention use cases for when to use the module and when not to
+
+commit 56ebbd899f709b3fae7e382ac3429a4c87867c63
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Oct 3 16:32:36 2012 +0200
+
+    man: some typos and grammar fixes
+
+commit 0303d5418ec7a3825433e308f195fc41fecb9ded
+Author: Peter Hutterer <peter.hutterer@who-t.net>
+Date:   Tue Oct 2 14:40:05 2012 +1000
+
+    man: point out that the joystick module is not a joystick driver
+    
+    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+
+commit acd398ac712689fb5239410d1da706752aa60a33
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Sep 25 10:57:46 2012 +0200
+
+    silence compiler warnings
+
 commit bdf8fd3f650789d2012ec0cc915729dd1e91346d
 Author: Sascha Hlusiak <saschahlusiak@arcor.de>
 Date:   Sun Mar 11 11:45:08 2012 +0100
diff --git a/debian/changelog b/debian/changelog
index 50b352b..8765088 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-input-joystick (1:1.6.2-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Michele Cane <michele.cane@gmail.com>  Thu, 11 Jul 2013 09:17:46 +0200
+
 xserver-xorg-input-joystick (1:1.6.1-1) unstable; urgency=low
 
   * New upstream release.

commit 426c3aa3c8a2385f17e37ae73c1e78f072656027
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Jan 16 10:52:12 2013 +0100

    joystick 1.6.2
    
    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>

diff --git a/configure.ac b/configure.ac
index b8c8851..b5834a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-input-joystick],
-        [1.6.1],
+        [1.6.2],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-input-joystick])
 AC_CONFIG_SRCDIR([Makefile.am])

commit 8f9342484afbbd26296c627497cc278f600098ac
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Jan 16 11:06:39 2013 +0100

    config: warning in default xorg.conf.d snippet: do not enable by default
    
    see discussion: https://bugs.gentoo.org/show_bug.cgi?id=403003
    
    distributions should not ship the module enabled by default, because a lot
    of users have the joystick module installed without knowing, resulting in
    confusion and bad user experience when trying to play games, the more
    likely usecase when plugging in a joystick.
    
    the default configuration only fits for a limited number of users.
    
    it does not make much sense to automatically enable hotplugging of the
    module without explicit user consent and reviewing of the configuration.
    
    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>

diff --git a/config/50-joystick-all.conf b/config/50-joystick-all.conf
index 6e780fd..0723086 100644
--- a/config/50-joystick-all.conf
+++ b/config/50-joystick-all.conf
@@ -11,6 +11,10 @@
 Section "InputClass"
 	Identifier "joystick-all"
 
+	# Note, that enabling this by default without explicit user
+	# consent might result in unexpected behaviour for those,
+	# that do not know that this module has been installed.
+
 	# UNCOMMENT TO ENABLE HOTPLUGGING OF JOYSTICKS
 #	Driver "joystick"
 #	MatchIsJoystick "on"

commit 819ba33c9d7440cd40e1e54a9b1e073ed89353a7
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Sat Oct 6 18:28:53 2012 +0200

    jast_axis: tune accelerated axis transformation to better work with circular axis fields
    
    reference: https://bugs.freedesktop.org/show_bug.cgi?id=42399
    
    joysticks with a rectangular field have a
    corner position of (32768,32768), joysticks with a
    circular field have (23170,23170).
    
    make sure that diagonal movement feels fast. either:
    1) linear
    
      f(32768) ~= f(23170) + f(23170)
      f(32768) ~= a * f(23170)
             a  = 2.0
    
      on circular joysticks, the time needed for xy movement is
      exactly the time needed for x + the time for y separately.
      absolute diagonal travel speed (in cm/s) is 0.707 times as fast,
      which feels pretty slow.
    
      on square joysticks, diagonal travel speed is always 1.41 times
      faster than orthogonal travel speed. time needed for diagonal
      movement is always 0.5 times as long as for orthogonal movement.
    
      the value of a = 2.0 results in a nice, non-linear acceleration.
    
    or
    2) trigonometric
    
      f(32768) ~= sqrt(f(23170)^2 + f(23170)^2))
      f(32768) ~= a * f(23170)
      a = 1.414
    
    on circular joysticks, the absolute pointer travel speed
    (in cm/s) is now the same for both linear and diagonal movement,
    which feels natural. moving diagonally takes 0.707 times the time
    of moving orthogonally.
    
    on square joysticks, values are as in 1)
    
    the value of a = 1.414 results in linear acceleration, which feels
    too slow.
    
    to maintain non-linear acceleration, make sure that:
    
    a >>= 1.414
    
    the following formula achieves results inbetween,
    so it should feel natural on both devices while maintaining a
    nice acceleration:
    
    f(32768) ~= 1.620 * f(23170)

diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index 95ebfe9..cb4a004 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -82,9 +82,62 @@ jstkAxisTimer(OsTimerPtr        timer,
             /* Calculate scale value, so we get a range from 0 to 32768 */
             scale = (32768.0f / (float)(32768 - axis->deadzone));
 
+	    /* NOTE: joysticks with a rectangular field have a
+	     * corner position of (32768,32768), joysticks with a
+	     * circular field have (23170,23170).
+	     *
+	     * make sure that diagonal movement feels fast. either:
+	     * 1) linear
+	     * 
+	     *   f(32768) ~= f(23170) + f(23170)
+	     *   f(32768) ~= a * f(23170)
+	     *          a  = 2.0
+	     *
+	     *   on circular joysticks, the time needed for xy movement is
+	     *   exactly the time needed for x + the time for y separately.
+	     *   absolute diagonal travel speed (in cm/s) is 0.707 times as fast, 
+	     *   which feels pretty slow.
+	     *
+	     *   on square joysticks, diagonal travel speed is always 1.41 times
+	     *   faster than orthogonal travel speed. time needed for diagonal
+	     *   movement is always 0.5 times as long as for orthogonal movement.
+	     * 
+	     *   the value of a = 2.0 results in a nice, non-linear acceleration.
+	     *
+	     * or
+	     * 2) trigonometric
+	     * 
+	     *   f(32768) ~= sqrt(f(23170)^2 + f(23170)^2))
+	     *   f(32768) ~= a * f(23170)
+	     *           a = 1.414
+	     *
+	     *   on circular joysticks, the absolute pointer travel speed
+	     *   (in cm/s) is now the same for both linear and diagonal movement,
+	     *   which feels natural. moving diagonally takes 0.707 times the time
+	     *   of moving orthogonally.
+	     * 
+	     *   on square joysticks, values are as in 1)
+	     * 
+	     *   the value of a = 1.414 results in linear acceleration, which feels
+	     *   too slow.
+	     * 
+	     * to maintain non-linear acceleration, make sure that:
+	     *
+	     *   a >>= 1.414 
+	     *
+	     * the following formula achieves results inbetween,
+	     * so it should feel natural on both devices while maintaining a
+	     * nice acceleration:
+	     * 
+	     *   f(32768) ~= 1.620 * f(23170)
+	     * 
+	     * TODO: make this simpler by using only values -1.0..1.0 and
+	     *       provide acceleration graphs.
+	     */
+
             /* How many pixels should this axis move the cursor */
-            p1 = ((pow((abs((float)axis->value) - (float)axis->deadzone) *
-                  scale / 1700.0f, 3.4f)) + 100.0f) *
+            p1 = (pow((abs((float)axis->value) - (float)axis->deadzone) *
+                  scale / 23, 1.4f) + 100.0f) *
                  ((float)NEXTTIMER / 40000.0f);
             /* How many "pixels" should this axis scroll */
             p2 = ((pow((abs((float)axis->value) - (float)axis->deadzone) *

commit 342057bf38e2da46609ed2fa0d3f5fb46c8ed215
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Sat Oct 6 16:18:24 2012 +0200

    backend_evdev: fix scaling overflow for high resolution axes
    
    The module scales all axis values from the kernel to the range of
    -32768 .. 32768, for compatibility with the old joystick kernel module.
    
    The current implementation had an integer overflow, if the axis had a high
    resolution of > 16384, like the popular XBox 360 controller.
    
    This commitmakes the scaling use float instead to fix erratic behaviour
    on high resolution joysticks. The joystick backend was not affected.
    
    Fixes bug: https://bugs.freedesktop.org/show_bug.cgi?id=42399

diff --git a/src/backend_evdev.c b/src/backend_evdev.c
index d3c12c5..ca0b2e0 100644
--- a/src/backend_evdev.c
+++ b/src/backend_evdev.c
@@ -277,8 +277,30 @@ jstkReadData_evdev(JoystickDevPtr joystick,
             struct jstk_evdev_axis_data *axis;
             axis = &data->axis[iev.code];
             if ((axis->number >= 0) && (axis->number < MAXAXES)) {
-                value = (iev.value - axis->min) * 65535
-                        / (axis->max - axis->min) - 32768;
+		/* NOTE: controllers report totally different ranges:
+		 * - 0..256, with a center of 127 (Logitech Dual Action axes)
+		 * - 0..256 with a center of 0 (XBox left/right triggers)
+		 * - -32768..32768 with a center of 0 (XBox axes)
+		 * 
+		 * These ranges will ALL be scaled to -32768..32768, with
+		 * the center value to be assumed 0. This is for compatibility
+		 * with the legacy joystick module, which reports values in
+		 * the same range.
+		 * 
+		 * The value is also important for the deadzone, which can be 
+		 * configured by the user and is in -32768..32768 range.
+		 * 
+		 * TODO: how to respect center value, so that that XBox triggers
+		 *       and logitech axes report idle, when not moved?
+		 * TODO: report all values as -1.0f..1.0f, but this would possibly
+		 *       break config file semantics.
+		 */
+		    
+		float v = (float) iev.value;
+		v = (v - (float)axis->min) * 65535.0f
+			/ (axis->max - axis->min) - 32768.0f;
+		value = (int) v;
+
                 if (abs(value) < joystick->axis[axis->number].deadzone) {
                     /* We only want one event when in deadzone */
                     if (joystick->axis[axis->number].value != 0) {

commit 053405f711512959e95d0a882d69b6cba6405e7d
Author: Gaetan Nadon <memsize@videotron.ca>
Date:   Sun Jan 13 10:56:53 2013 -0500

    Replace deprecated Automake INCLUDES variable with AM_CPPFLAGS
    
    Excerpt https://lists.gnu.org/archive/html/automake/2012-12/msg00038.html
    
      - Support for the long-deprecated INCLUDES variable will be removed
        altogether in Automake 1.14.  The AM_CPPFLAGS variable should be
        used instead.
    
    This variable was deprecated in Automake releases prior to 1.10, which is the
    current minimum level required to build X.
    
    Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
    Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/src/Makefile.am b/src/Makefile.am
index 21cdf32..c8e8b93 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,7 @@ AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
 @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
 @DRIVER_NAME@_drv_ladir = @inputdir@
 
-INCLUDES=-I$(top_srcdir)/include/
+AM_CPPFLAGS = -I$(top_srcdir)/include
 
 @DRIVER_NAME@_drv_la_SOURCES =  jstk.c jstk.h \
 				jstk_axis.c jstk_axis.h \

commit baa96c22e74b5f617b64d9f5ae21c52a4c4fa190
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Oct 3 18:53:00 2012 +0200

    configure: enable debug output code by default
    
    there are rare cases when disabling debug code gives any benefit but the lack of debugging output,
    which needs to be enabled anyway with the DebugLevel option

diff --git a/configure.ac b/configure.ac
index 1bcc62a..b8c8851 100644
--- a/configure.ac
+++ b/configure.ac
@@ -76,9 +76,9 @@ AC_ARG_WITH(sdkdir,
 AC_SUBST(sdkdir)
 
 # Define a configure option to enable code debugging
-AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],
-                                    [Enable debugging (default: disabled)]),
-                                    [DEBUGGING=$enableval], [DEBUGGING=no])
+AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],
+                                    [Disable debugging code (default: enabled)]),
+                                    [DEBUGGING=$enableval], [DEBUGGING=yes])
 if test "x$DEBUGGING" = xyes; then
    AC_DEFINE(DEBUG, 1, [Enable debugging code])
 fi

commit b427ad6066e966f63a0da82e4b0ef3344064f6a1
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Oct 3 18:44:58 2012 +0200

    man: more manpage tuning and polishing

diff --git a/man/joystick.man b/man/joystick.man
index 3696319..4158aa8 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -35,9 +35,7 @@ for playing legacy games, that have no native joystick support
 .B Do not use, if you want to
 - play games, that have native joystick support
 
-- use XI2 applications. The
-.B evdev(4)
-driver will suffice for those in most cases.
+- use XI2 applications. The evdev(4) driver will suffice for those in most cases.
 
 .PP
 You may mix above scenarios by setting the device 
@@ -79,7 +77,7 @@ are supported:
 .BI "Option \*qPath\*q \*q" string \*q
 Specifies the device through which the joystick can be accessed. This option is mandatory and there is no default setting.
 
-For Linux, joysticks are mostly accessible as
+In Linux, joysticks are usually accessible through
 .IR /dev/input/jsX " or " /dev/input/eventX .
 
 In *BSD, joysticks are usually recognized as 
@@ -93,21 +91,22 @@ is the time in milliseconds before a key starts repeating.
 is the number of times a key repeats per second.  Default: Xorg default
 .TP 7
 .BI "Option \*qDebugLevel\*q \*q" integer \*q
-If compiled with debugging information, controls the verbosity of the driver.
-The higher the DebugLevel, the more output is produced.
+Controls the verbosity of the driver for debugging purposes. The higher the DebugLevel, the more output is produced.
 Default: 0
 .TP 7
 .BI "Option \*qMapButton<number>\*q \*q" string \*q
-Sets the mapping of the joystick button to the desired action. Counting of buttons starts with 
+Sets the mapping of a joystick button to the desired action. Button counting starts with 
 .IR 1 ,
 Possible options are:
 .RS 7
 .TP 7
 .B "none"
-This joystick button won't do anything.
+Don't do anything
 .TP 7
 .BI "\*qbutton="<number> \*q
-The joystick button will generate a click with the specified button (starting with 1).
+Generate a pointer button event with button
+.I number
+(starting with 1).
 .TP 7
 .BI "\*qaxis="[<factor>]<axis> \*q
 Where
@@ -119,15 +118,15 @@ and
 .I <factor>
 is an optional amplifier of the axis, like
 .B -, +, -5, 0.4, 1.3, ...
-Use positive and negative values to control the direction. Default: 1.0
+Negative values invert the direction. Default: 1.0
 .TP 7
 .BI "\*qamplify="<factor> \*q
-Amplifies the movement of all axes by the given factor when pressed. Different
+Amplifies the movement of all axes by the given factor when this button is held down. Different
 factors can be combined.
 .TP 7
 .BI "\*qkey="<scancode>[,<scancode>[,<scancode>[,<scancode>]]]
-When button is pressed, a series of keydown events with the specified scancode is
-generated. When the button is released, keyup events in the opposite
+When button is pressed, a series of keydown events with the specified scancodes is
+generated. When the button is released, matching keyup events in the opposite
 order are generated. You can specify up to 4 scancodes per button.
 
 See special section about key events below.
@@ -140,11 +139,15 @@ See special section about key events below.
 Disables either the generation of mouse events, key events or the generation of
 all X events by the driver. Press button again to allow the driver to generate 
 events again.
+
+You may also set the device
+.B floating
+from client space to prevent it from generating core events.
 .RE
 .PP
 .TP 7
 .BI "Option \*qMapAxis<number>\*q \*q" string \*q
-Sets the mapping of the axis to the desired action. Counting of axes starts with
+Sets the mapping of the axis to the desired action. Axis counting starts with
 .IR 1 ,
 the parameter may contain:
 .RS 7
@@ -158,7 +161,9 @@ can be one of:
 
 .TP 7
 .B \*qvaluator\*q
-Send extra valuator events for this axis. The valuators will be numbered ascending, starting with 2 (valuator 0 and 1 are reserved for pointer movement). The range of the valuators is always 
+Send extra valuator events for this axis. The valuators will be numbered ascending, starting with 2 (valuator 0 and 1 are reserved for pointer movement). Please consider using the evdev(4) input driver if you are only interested in XI2 features.
+
+The range of the valuators is always 
 .IR -32767 " to " 32768 .
 Neither
 .B mode
@@ -183,17 +188,17 @@ is an optional amplifier of the axis, like
 .B -, +, -5, 0.4, 1.3, ...
 Negative values will invert the movement. Default: 1.0
 .TP 7
-.BI "\*qkeylow= "<scancode>[,<scancode>[,<scancode>[,<scancode>]]]
+.BI "\*qkeylow="<scancode>[,<scancode>[,<scancode>[,<scancode>]]]
 .TP 7
 .BI "\*qkeyhigh="<scancode>[,<scancode>[,<scancode>[,<scancode>]]]
 When the axis is moved out of the deadzone, a series of keydown events according 
-to the direction of the movement is generated. When the axis is released, keyup 
-events will be generated. You can specify up to 4 scancodes for each direction. 
+to the direction of the movement is generated. When the axis is released, matching keyup 
+events in opposite order will be generated. You can specify up to 4 scancodes for each direction.
 
 .B keylow
-defines the keys to be generated when the axis is moved in negative direction (ie. left or up),
+defines the keys to be generated when the axis is moved in negative direction (left or up),
 .B keyhigh
-defines the keys to be generated when the axis is moved in positive direction (ie. right or down).
+defines the keys to be generated when the axis is moved in positive direction (right or down).
 
 If 
 .B mode
@@ -266,17 +271,17 @@ The default configuration is as follows:
 .SH "ACCELERATED AXIS CONFIGURATION"
 .B Accelerated
 mode should be selected, if the axis is a
-.IR pad ,
-which reports only three states: negative, center, positive. It will produce a smooth acceleration of the movement
-when the axis is deflected. The speed will be affected by the factor of the axis, but not the acceleration speed.
+.IR "directional pad" ,
+which reports only three states: negative, center, positive. It will result in smoothly accelerated movement
+when the axis is deflected. An optional factor will affect the acceleration and final speed.
 
-This example will set up the axis as scrolling vertically inverted, with half of the speed:
+This example will set up the axis as scrolling vertically inverted, with half the speed:
 .nf
 .BI "  Option \*qMapAxis1\*q     \*q" "mode=accelerated axis=-0.5zy" \*q
 .fi
 
-This example maps four buttons to the four half axes, so you can use them like a pad. The movement will get half
-the normal speed:
+This example maps four buttons to the four pointer directions, so you can use the buttons like a d-pad. The movement will be accelerated
+with half the normal speed:
 .nf
 .BI "  Option \*qMapButton1\*q     \*q" "axis=+0.5x" \*q
 .BI "  Option \*qMapButton2\*q     \*q" "axis=-0.5x" \*q
@@ -285,15 +290,11 @@ the normal speed:
 .fi
 
 .SH "ABSOLUTE AXIS CONFIGURATION"
-With the
+In
 .B absolute
-axis mode, the position of the cursor will be fixed to the position, according to the deflection of the axis.
-This fixed position is calculated around the previous position of the cursor. You can specify the range in pixels,
-the cursor can move. The default range is the
-.I width
-of the screen, when mapped to the x-axis and the
-.I height
-of the screen, when mapped to the y-axis. This mode can be combined with the other modes without problems.
+axis mode, the
+.I position of the cursor will match the
+.I position of the configured axis, but relative to the previous position of the cursor. You can specify the range in which the cursor can move. The default range is the screen size.
 
 In this example the first axis gets a range from left to the right of the screen. The second axis gets a
 total range of 200 pixels, 100 to the top and 100 to the bottom:
@@ -303,15 +304,13 @@ total range of 200 pixels, 100 to the top and 100 to the bottom:
 .fi
 
 .SH "GENERATING KEY EVENTS"
-Providing a \*qkey=<scancode>[,<scancode>[...]]\*q option will generate X Events with the specified scancodes
-when the joystick button is pressed or the axis changed its position. When the button/axis is released, the keys are released in the reverse order.
+Providing a \*qkey=<scancode>[,<scancode>[...]]\*q option will generate X Events with specified scancodes. When the button/axis is released, the keys will be released in opposite order.
 
-To lookup keycodes for KeySyms, you can use
+If you want a certain KeySym, look up the matching scancode using
 .BR "xmodmap -pk" .
-You can use unused keycodes and map them to a KeySym of your choice using xmodmap(1).
+The scancodes depend on the configured keyboard layout. You can also use unused keycodes and map them to a KeySym of your choice using xmodmap(1).
 
-You can specify up to 4 scancodes per joystick button/axis, which is useful to use modificators. Make sure you use modificators
-that are necessary to get a certain keysym.
+You can specify up to 4 scancodes per joystick button/axis, which can be used for modificators to get the KeySym you want.
 
 Examples:
 .nf
@@ -324,13 +323,15 @@ when the button is pressed.
 .nf
 .BI "  Option \*qMapButton1\*q     \*q" "key=50,40" \*q
 .fi
-will generate a Shift_L+d which will be an uppercase 
+will generate a 
+.I "Shift_L+d"
+which will result in an uppercase 
 .IR d .
 
 .nf
 .BI "  Option \*qMapButton1\*q     \*q" "key=65" \*q
 .fi
-is for the  
+will result in a
 .IR "space " key.
 
 .nf
@@ -343,11 +344,17 @@ will map the first and third axis to the arrow keys
 .IR left " and " right
 and the second and fourth axis to the arrow keys
 .IR up " and " down .
+
 The keys for the first two axes will be generated in an interval according to the value of the axis. The autorepeat speed of the first axis will be half the speed of that of the second axis.
 The keys for the third and fourth axis are generated once when the axis moves out of the deadzone and when it moves back into the deadzone. X.Org will autorepeat those keys according to current keyboard settings.
 
 .SH "XI2 Events"
-If you only care about raw events instead of using the joystick as a mouse replacement, don't forget to unmap and add valuators to all axes and map the remaining buttons:
+If you only care about raw valuator events instead of using the joystick to control the cursor, consider using the evdev(4)
+input driver. If you still use the
+.B joystick
+driver for raw events, make sure to unmap all axes/buttons and add the
+.B valuator
+option to the axes:
 
 .nf
 .BI "  Option  \*qMapAxis1\*q      \*q" "mode=none valuator" \*q
@@ -363,17 +370,24 @@ If you only care about raw events instead of using the joystick as a mouse repla
 \ \ ...
 .fi
 
+Remember, that valuators 0 and 1 are reserved for pointer movement, additional axes will start with valuator 2.
+
 You might also want to set the device "floating" to stop it from reporting core events:
 .nf
 .BI "  Option  \*qFloating\*q      \*q" "true" \*q
 .fi
 
 .SH "NOTES"
+It is not recommended to enable the
+.B joystick
+input driver by default unless explicitely requested by the user.
+
 Configuration through
 .I InputClass
-sections is recommended in X servers 1.8 and later. See xorg.conf.d(5) for more details. An example xorg.conf.d snipped is provided in 
+sections is recommended in X servers 1.8 and later. See xorg.conf.d(5) for more details. An example xorg.conf.d(5) snipped is provided in 
 .I ${sourcecode}/config/50-joystick-all.conf
 
+
 Configuration through hal fdi files is recommended in X servers 1.5,
 1.6 and 1.7. An example hal policy file is still provided in 
 .I ${sourcecode}/config/50-x11-input-joystick.fdi
@@ -384,6 +398,6 @@ to be placed in
 .SH "SEE ALSO"
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorg.conf.d(5), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
 .SH AUTHORS
-Sascha Hlusiak (2007-2011),
+Sascha Hlusiak (2007-2012),
 .fi
 Frederic Lepied (1995-1999)

commit 4b0ca090b71e70cc2b5bcd93ed40fc8c40c499fa
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Oct 3 18:44:06 2012 +0200

    config: mention floating option in xorg.conf.d snippet

diff --git a/config/50-joystick-all.conf b/config/50-joystick-all.conf
index ee03dd5..6e780fd 100644
--- a/config/50-joystick-all.conf
+++ b/config/50-joystick-all.conf
@@ -16,6 +16,9 @@ Section "InputClass"
 #	MatchIsJoystick "on"
 #	MatchDevicePath "/dev/input/event*"
 
+	# UNCOMMENT TO SET THE DEVICE FLOATING ON HOTPLUG
+#	Option "Floating"	"true"
+
 	Option "MapButton1" "button=1"
 	Option "MapButton2" "button=2"
 	Option "MapButton3" "button=3"

commit c473c8bd7985441d8264f8f48537d39dbe0c874e
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Oct 3 17:39:55 2012 +0200

    man: mention use cases for when to use the module and when not to

diff --git a/man/joystick.man b/man/joystick.man
index 97479fc..3696319 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -9,7 +9,7 @@ Snipped for xorg.conf.d(5):
 .nf
 .B "Section \*qInputClass\*q"
 .BI "  Identifier \*q" joystick-all \*q
-.BI  "  Driver \*q" joystick \*q
+.BI "  Driver \*q" joystick \*q
 .BI "  Option \*qMatchIsJoystick\*q   \*q" on \*q
 .BI "  Option \*qMatchDevicePath \*q" /dev/input/event* \*q
 \ \ ...
@@ -20,11 +20,32 @@ Snipped for xorg.conf.d(5):
 .SH DESCRIPTION
 .B joystick
 is an __xservername__ input driver for controlling the pointer with a
-joystick device. It is
-.B not a joystick driver for games,
-the
-.B evdev
+joystick device.
+.TP 3
+Use this driver, if you want to
+- generate 
+.IR "cursor movement" ,
+perform button or key events to control desktop and applications
+
+- generate 
+.I "cursor key events"
+for playing legacy games, that have no native joystick support
+
+.TP 3
+.B Do not use, if you want to
+- play games, that have native joystick support
+
+- use XI2 applications. The
+.B evdev(4)
 driver will suffice for those in most cases.
+
+.PP
+You may mix above scenarios by setting the device 
+.IR floating .
+The driver reports relative cursor movement, button and key events,
+as well as raw axis values through valuators.
+
+.SH SUPPORTED HARDWARE
 The joystick input module can be used on top of the following kernel devices:
 
 .nf
@@ -33,10 +54,6 @@ The joystick input module can be used on top of the following kernel devices:
 .B - BSD's usbhid device
 .fi
 
-The driver reports cursor movement
-as well as raw axis values through valuators.
-
-.SH SUPPORTED HARDWARE
 Every joystick supported by the kernel should be supported by the 
 .B joystick
 input driver. The joystick is assumed to be calibrated and reporting axis values
@@ -44,6 +61,10 @@ between
 .IR "-32768 " and " 32768" .
 See the Linux kernel documentation for a complete list of supported devices.
 
+There is no support for
+.B force feedback
+at the moment.
+
 .SH CONFIGURATION DETAILS
 Please refer to __xconfigfile__(__filemansuffix__) for general configuration
 details.  This section only covers configuration details specific to this

commit 56ebbd899f709b3fae7e382ac3429a4c87867c63
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Oct 3 16:32:36 2012 +0200

    man: some typos and grammar fixes

diff --git a/man/joystick.man b/man/joystick.man
index 274e4c5..97479fc 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -25,24 +25,24 @@ joystick device. It is
 the
 .B evdev
 driver will suffice for those in most cases.
-There are 3 backends available that are used in the following order, if support was found:
+The joystick input module can be used on top of the following kernel devices:
 
 .nf
-.B - Linux's evdev interface
-.B - Linux's joystick interface
-.B - BSD's usbhid interface
+.B - Linux's evdev device
+.B - Linux's joystick device
+.B - BSD's usbhid device
 .fi
 
 The driver reports cursor movement
-as well as raw axis values through valuators. 
+as well as raw axis values through valuators.


Reply to: