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

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



 .gitignore                    |    4 
 ChangeLog                     |  156 +++++++++++++++++++++++++++++++++++++
 Makefile.am                   |    8 -
 README                        |   20 ++++
 configure.ac                  |   26 ++++--
 debian/changelog              |    6 +
 include/joystick-properties.h |    4 
 man/.gitignore                |    3 
 man/joystick.man              |    8 +
 src/.gitignore                |    6 -
 src/Makefile.am               |    2 
 src/backend_bsd.c             |    6 -
 src/backend_evdev.c           |    4 
 src/backend_joystick.c        |    4 
 src/jstk.c                    |   27 +++---
 src/jstk.h                    |    4 
 src/jstk_axis.c               |  173 +++++++++++++++++++++++++++++++++++++++++-
 src/jstk_axis.h               |    1 
 src/jstk_key.c                |   26 +++++-
 src/jstk_options.c            |    2 
 src/jstk_properties.c         |   66 ++++++++++++++--
 21 files changed, 492 insertions(+), 64 deletions(-)

New commits:
commit e2304355f74011fccb8a03d2861b918eea4f9ee4
Author: Brice Goglin <bgoglin@debian.org>
Date:   Wed Apr 15 13:16:50 2009 +0200

    Prepare changelog for upload

diff --git a/debian/changelog b/debian/changelog
index da342e4..b6903ac 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-xserver-xorg-input-joystick (1:1.4.1-1) UNRELEASED; urgency=low
+xserver-xorg-input-joystick (1:1.4.1-1) unstable; urgency=low
 
   * New upstream release.
 
- -- Brice Goglin <bgoglin@debian.org>  Wed, 15 Apr 2009 13:14:47 +0200
+ -- Brice Goglin <bgoglin@debian.org>  Wed, 15 Apr 2009 13:16:37 +0200
 
 xserver-xorg-input-joystick (1:1.4.0-1) unstable; urgency=low
 

commit c20bd51fe07066594ab623079de85daec6b5b7d8
Author: Brice Goglin <bgoglin@debian.org>
Date:   Wed Apr 15 13:16:34 2009 +0200

    New upstream release

diff --git a/ChangeLog b/ChangeLog
index c524a7f..8a25d7b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,159 @@
+commit 88a084952f547ebc2f30a257e441930024a69be9
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Apr 14 22:33:01 2009 +0200
+
+    Fail configure on xorg-server >= 1.6.99
+    
+    The 1.4 branch is broken on xorg-server >= 1.6.99. Use master instead.
+
+commit 7d6a068c29e372747fc621020976797df9f61bac
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Apr 14 22:25:49 2009 +0200
+
+    Bump 1.4.1
+
+commit e1710072396a97369ef71b1fd1738ad092a5e902
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Mar 19 21:14:22 2009 +0100
+
+    Fix compiler warning about stray INT8-CARD8 conversion
+
+commit 7af61c78fd48ea9cc2442fb55570ba0d9f37f8c8
+Merge: bc430cc 4b9aafd
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Mar 19 21:13:13 2009 +0100
+
+    Merge branch 'pwm'
+
+commit bc430cc2aacdcda45ddc38d457b84ff040be6a8c
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Mar 19 21:08:30 2009 +0100
+
+    Missing initialization of button amplify
+    
+    Always initialize button[]->amplify with 1.0
+
+commit dca19bde2bdd275744e9182dd49a2f2dd81f8c81
+Merge: 6f2a211 c6217b5
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Mar 19 08:36:10 2009 +0100
+
+    Merge branch 'master' of sascha:develop/xorg/xf86-input-joystick
+
+commit 4b9aafd82bf78e86b2b2ddc78c37d73ccc7c25d5
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Mar 18 18:13:12 2009 +0100
+
+    Mention PWM mode in man page
+
+commit 6f2a211b7c3b45e8de9a90835fb7f1a24635c8e5
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Wed Mar 18 17:39:07 2009 +0100
+
+    Fix build on FreeBSD with USB2
+    
+    Including dev/usb/usb_ioctl.h fixes missing declaration
+    of USB_GET_REPORT_ID on FreeBSD-Current.
+
+commit c6217b5849b1c2680a9a8c29ca26b3468955b1c1
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Sun Mar 1 21:06:52 2009 +0100
+
+    Comment float properties in joystick-properties.h
+    
+    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+
+commit 367c32bab57d69d85e95f4e76e2f1c8aaab45189
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Sun Mar 1 21:00:18 2009 +0100
+
+    Support for float properties
+    
+    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
+
+commit 4978e78e7c49bc0aabf5c7ade4223c2529a9f046
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Feb 19 23:40:58 2009 +0100
+
+    Add PWM key generation when axis in accelerated mode
+    
+    When axis is in accelerated mode and keyhigh/keylow is set,
+    the deflection of the axis will be linked to the _percent of time_ the key
+    will be down. Full deflection will set the key permanently down (old behaviour).
+    
+    50% deflection will result in the key being  50ms down and 50ms up.
+    75% deflection will result in the key being 150ms down and 50ms up.
+    etc.
+    Minimum interval is 50ms, maximum is 600ms.
+
+commit d4bb86ddb0ba570de0f501cd0edb13861456b711
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Thu Feb 19 23:37:46 2009 +0100
+
+    Don't set axis.oldvalue in backend
+    
+    The value needs to be set where it's needed, like in timers.
+
+commit 4ec4376522b1c393ee44f25adcd28b12d7cadff6
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Tue Feb 17 20:18:05 2009 +0100
+
+    Fix for sparse warning of uninitialized variable
+    
+    If axis is inside deadzone, 0.0 should be assumed.
+
+commit b70b1f7d827b87ceb63110c781b01175363fb7d0
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Feb 4 18:23:00 2009 -0200
+
+    Janitor: gcc 4.5 and sparse warnings.
+    
+    It is still required a patch in the X Server sdk to correct some
+    remaining warnings. Isn't it amazing that <X11/extensions/XKBsrv.h>
+    and $sdkdir/xkbsrv.h both use the #ifndef _XKBSRV_H_ include guard?
+    
+    Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+
+commit 76b82a41a6733ef5a2a89dd370357320ea78792a
+Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+Date:   Wed Feb 4 18:10:26 2009 -0200
+
+    Janitor: make distcheck, .gitignore.
+    
+    The correction for make distcheck uses the same solution proposed
+    for xf86-input-evdev, that uses the new configure option --with-sdkdir.
+    
+    Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
+
+commit 4671904035d4da4d112f53cce8781bcc77b0d0db
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Mon Feb 2 00:10:42 2009 +0100
+
+    Use InitKeyboardDeviceStruct instead of nonexistant XkbInitKeyboardDeviceStruct
+    
+    Realizing XkbInitKeyboardDeviceStruct has been removed, we do need to use InitKeyboardDeviceStruct.
+    This breaks custom keymaps on ABI_XINPUT_VERSION >= 5.
+    
+    Hopefully this can be reimplemented later.
+
+commit 3984947ada771619f21b511507a2fb9cca3ed645
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jan 30 20:23:09 2009 -0800
+
+    Add README with pointers to mailing list, bugzilla & git repos
+
+commit fb632ba226725a7101c5c1a3bfc2201905532b6f
+Author: Sascha Hlusiak <saschahlusiak@arcor.de>
+Date:   Mon Jan 26 20:48:00 2009 +0100
+
+    Fix build on master. All hail XKB!
+
+commit f62159e4dfc22550ec2de3eb4fd46027d85a1e88
+Author: Alan Coopersmith <alan.coopersmith@sun.com>
+Date:   Fri Jan 9 16:14:12 2009 -0800
+
+    Remove xorgconfig & xorgcfg from See Also list in man page
+
 commit 43e2f0526894cb5eacac8730a21ccdf415421d72
 Author: Sascha Hlusiak <saschahlusiak@arcor.de>
 Date:   Sun Dec 28 18:57:36 2008 +0100
diff --git a/debian/changelog b/debian/changelog
index 71ac20e..da342e4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-input-joystick (1:1.4.1-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Brice Goglin <bgoglin@debian.org>  Wed, 15 Apr 2009 13:14:47 +0200
+
 xserver-xorg-input-joystick (1:1.4.0-1) unstable; urgency=low
 
   * Run autoreconf on build.

commit 88a084952f547ebc2f30a257e441930024a69be9
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Tue Apr 14 22:33:01 2009 +0200

    Fail configure on xorg-server >= 1.6.99
    
    The 1.4 branch is broken on xorg-server >= 1.6.99. Use master instead.

diff --git a/configure.ac b/configure.ac
index 19fcf81..4ac344d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,7 +72,7 @@ XORG_DRIVER_CHECK_EXT(XKB, kbproto)
 
 # Checks for pkg-config packages
 PKG_CHECK_MODULES(XORG, 
-               [xorg-server >= 1.3.99.901] xproto $REQUIRED_MODULES)
+               [xorg-server >= 1.3.99.901 xorg-server <= 1.6.99] xproto $REQUIRED_MODULES)
 XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS"
 xorg_sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 AC_ARG_WITH(sdkdir,

commit 7d6a068c29e372747fc621020976797df9f61bac
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Tue Apr 14 22:25:49 2009 +0200

    Bump 1.4.1

diff --git a/configure.ac b/configure.ac
index d8e107b..19fcf81 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-joystick],
-        1.4.0,
+        1.4.1,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-input-joystick)
 

commit e1710072396a97369ef71b1fd1738ad092a5e902
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Thu Mar 19 21:14:22 2009 +0100

    Fix compiler warning about stray INT8-CARD8 conversion

diff --git a/src/jstk_properties.c b/src/jstk_properties.c
index 837606c..f2c562a 100644
--- a/src/jstk_properties.c
+++ b/src/jstk_properties.c
@@ -197,7 +197,7 @@ jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val,
         CARD8 *values;
         if (val->size != priv->num_buttons || val->format != 8 || val->type != XA_INTEGER)
             return BadMatch;
-        values = (INT8*)val->data;
+        values = (CARD8*)val->data;
         for (i = 0; i<val->size; i++) {
             if (values[i] > BUTTONMAP_SIZE) {
                DBG(1, ErrorF("Button number out of range (0..%d): %d\n",

commit bc430cc2aacdcda45ddc38d457b84ff040be6a8c
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Thu Mar 19 21:08:30 2009 +0100

    Missing initialization of button amplify
    
    Always initialize button[]->amplify with 1.0

diff --git a/src/jstk.c b/src/jstk.c
index a5ea298..c747b40 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -561,6 +561,7 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
         priv->button[i].mapping      = JSTK_MAPPING_NONE;
         priv->button[i].currentspeed = 1.0f;
         priv->button[i].subpixel     = 0.0f;
+        priv->button[i].amplify      = 1.0;
         for (j=0; j<MAXKEYSPERBUTTON; j++)
             priv->button[i].keys[j] = 0;
     }

commit 4b9aafd82bf78e86b2b2ddc78c37d73ccc7c25d5
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Mar 18 18:13:12 2009 +0100

    Mention PWM mode in man page

diff --git a/man/joystick.man b/man/joystick.man
index 3199c07..03f9800 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -174,7 +174,11 @@ If
 .B mode
 is set to 
 .IR accelerated :
-One keydown event is generated, when the axis is moved out of the deadzone, the keyup event is generated, when the axis moves back to the deadzone. The keys will be autorepeated according to the keyboard settings.
+Keydown and keyup events will be generated repeatedly. The time between a keydown and a keyup event corresponds to the deflection of the axis.
+If the axis is deflected by 30%, the key will be considered to be down 300ms out of 1 second. The exact intervals may vary and can be adjusted with the
+.I amplify
+parameter. If the axis is deflected by 100%, there will only be one keydown event, so the key is considered down all the time.
+The keys will be autorepeated according to the Xorg keyboard settings.
 
 See special section about key events below.
 .TP 7

commit 6f2a211b7c3b45e8de9a90835fb7f1a24635c8e5
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Wed Mar 18 17:39:07 2009 +0100

    Fix build on FreeBSD with USB2
    
    Including dev/usb/usb_ioctl.h fixes missing declaration
    of USB_GET_REPORT_ID on FreeBSD-Current.

diff --git a/configure.ac b/configure.ac
index fc4627a..d8e107b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,7 @@ AC_CHECK_HEADERS([usbhid.h dev/usb/usbhid.h],, [bsd_backend=no],
 AC_CHECK_LIB([usbhid],[hid_get_item],, [bsd_backend=no])
 AM_CONDITIONAL(BSD_BACKEND, [test "x$bsd_backend" = xyes])
 if test "x$bsd_backend" = xyes; then
+    AC_CHECK_HEADERS([dev/usb/usb_ioctl.h])
     AC_DEFINE(BSD_BACKEND, 1, [Compile BSD usbhid backend])
 fi
 
diff --git a/src/backend_bsd.c b/src/backend_bsd.c
index cf4cd90..60401b1 100644
--- a/src/backend_bsd.c
+++ b/src/backend_bsd.c
@@ -43,6 +43,9 @@
 #include <usbhid.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>
+#ifdef HAVE_DEV_USB_USB_IOCTL_H
+    #include <dev/usb/usb_ioctl.h>
+#endif
 
 #include "jstk.h"
 #include "backend_bsd.h"

commit c6217b5849b1c2680a9a8c29ca26b3468955b1c1
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Sun Mar 1 21:06:52 2009 +0100

    Comment float properties in joystick-properties.h
    
    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>

diff --git a/include/joystick-properties.h b/include/joystick-properties.h
index 8dc5447..0f0d4ed 100644
--- a/include/joystick-properties.h
+++ b/include/joystick-properties.h
@@ -90,7 +90,7 @@ typedef enum _JSTK_MAPPING {
 #define JSTK_PROP_AXIS_MAPPING   "Axis Mapping"
 
 /** Set movement factor of axis (default 1.0f) */
-/* TODO float, movement amplify value per axis */
+/* FLOAT[MAXAXES], movement amplify per axis */
 #define JSTK_PROP_AXIS_AMPLIFY "Axis Amplify"
 
 /** Set KeySyms for axis in low position */
@@ -112,7 +112,7 @@ typedef enum _JSTK_MAPPING {
 #define JSTK_PROP_BUTTON_BUTTONNUMBER "Button Number"
 
 /** Set amplify factor of button (default 1.0f) */
-/* TODO float, button amplify value per button */
+/* FLOAT[MAXBUTTONS], amplify value per button */
 #define JSTK_PROP_BUTTON_AMPLIFY "Button Amplify"
 
 /** Set KeySyms for button */

commit 367c32bab57d69d85e95f4e76e2f1c8aaab45189
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Sun Mar 1 21:00:18 2009 +0100

    Support for float properties
    
    Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>

diff --git a/src/jstk_properties.c b/src/jstk_properties.c
index 98f85c5..837606c 100644
--- a/src/jstk_properties.c
+++ b/src/jstk_properties.c
@@ -30,6 +30,7 @@
 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
 
 
+
 #include <misc.h>
 #include <xf86.h>
 #include <X11/Xatom.h>
@@ -58,6 +59,11 @@ static Atom prop_button_amplify = 0;
 static Atom prop_button_keys = 0;
 
 
+#ifndef XATOM_FLOAT
+#define XATOM_FLOAT "FLOAT"
+#endif
+static Atom float_type = 0;
+
 
 static int
 jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val,
@@ -154,8 +160,17 @@ jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val,
         }
     }else if (atom == prop_axis_amplify)
     {
-        /* FIXME */
-        return BadValue;
+        float *values;
+        if (val->size != priv->num_axes || val->format != 32 || val->type != float_type)
+            return BadMatch;
+        if (!checkonly)
+        {
+            values = (float*)val->data;
+            for (i =0; i<val->size; i++) {
+                priv->axis[i].amplify = values[i];
+                DBG(1, ErrorF("Amplify of axis %d set to %.3f\n", i, priv->axis[i].amplify));
+            }
+        }
     }else if (atom == prop_axis_keys_low)
     {
         /* FIXME */
@@ -203,8 +218,17 @@ jstkSetProperty(DeviceIntPtr pJstk, Atom atom, XIPropertyValuePtr val,
         return Success;
     }else if (atom == prop_button_amplify)
     {
-        /* FIXME */
-        return BadValue;
+        float *values;
+        if (val->size != priv->num_buttons || val->format != 32 || val->type != float_type)
+            return BadMatch;
+        if (!checkonly)
+        {
+            values = (float*)val->data;
+            for (i =0; i<val->size; i++) {
+                priv->button[i].amplify = values[i];
+                DBG(1, ErrorF("Amplify of button %d set to %.3f\n", i, priv->button[i].amplify));
+            }
+        }
     }else if (atom == prop_button_keys)
     {
         /* FIXME */
@@ -221,10 +245,22 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
     INT32 axes_values32[MAXAXES];
     INT8  axes_values8[MAXAXES];
     INT8  button_values8[MAXBUTTONS];
+    float axes_floats[MAXAXES];
+    float button_floats[MAXBUTTONS];
     int i;
 
     XIRegisterPropertyHandler(pJstk, jstkSetProperty, NULL, NULL);
 
+    float_type = XIGetKnownProperty(XATOM_FLOAT);
+    if (!float_type) {
+	float_type = MakeAtom(XATOM_FLOAT, strlen(XATOM_FLOAT), TRUE);
+	if (!float_type) {
+	    xf86Msg(X_WARNING, "%s: Failed to init float atom. "
+			       "Disabling support for float properties.\n", pJstk->name);
+	}
+    }
+
+
 #ifdef DEBUG
     /* Debug Level */
     prop_debuglevel = MakeAtom(JSTK_PROP_DEBUGLEVEL, strlen(JSTK_PROP_DEBUGLEVEL), TRUE);
@@ -300,7 +336,15 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
     XISetDevicePropertyDeletable(pJstk, prop_axis_mapping, FALSE);
 
     /* priv->axis[].amplify */
-    /* FIXME: prop_axis_amplify as float[] */
+    if (float_type) {
+	for (i=0;i<priv->num_axes;i++)
+	    axes_floats[i] = priv->axis[i].amplify;
+	prop_axis_amplify = MakeAtom(JSTK_PROP_AXIS_AMPLIFY, strlen(JSTK_PROP_AXIS_AMPLIFY), TRUE);
+	XIChangeDeviceProperty(pJstk, prop_axis_amplify, float_type, 32,
+				PropModeReplace, priv->num_axes, axes_floats,
+				FALSE);
+	XISetDevicePropertyDeletable(pJstk, prop_axis_amplify, FALSE);
+    }
 
     /* priv->axis[].keys_low */
     /* FIXME: prop_axis_keys_low */
@@ -336,7 +380,15 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
     XISetDevicePropertyDeletable(pJstk, prop_button_buttonnumber, FALSE);
 
     /* priv->button[].amplify */
-    /* FIXME: prop_button_amplify as float[] */
+    if (float_type) {
+	for (i=0;i<priv->num_buttons;i++)
+	    button_floats[i] = priv->button[i].amplify;
+	prop_button_amplify = MakeAtom(JSTK_PROP_BUTTON_AMPLIFY, strlen(JSTK_PROP_BUTTON_AMPLIFY), TRUE);
+	XIChangeDeviceProperty(pJstk, prop_button_amplify, float_type, 32,
+				PropModeReplace, priv->num_buttons, button_floats,
+				FALSE);
+	XISetDevicePropertyDeletable(pJstk, prop_button_amplify, FALSE);
+    }
 
     /* priv->button[].keys */
     /* FIXME: prop_button_keys */

commit 4978e78e7c49bc0aabf5c7ade4223c2529a9f046
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Thu Feb 19 23:40:58 2009 +0100

    Add PWM key generation when axis in accelerated mode
    
    When axis is in accelerated mode and keyhigh/keylow is set,
    the deflection of the axis will be linked to the _percent of time_ the key
    will be down. Full deflection will set the key permanently down (old behaviour).
    
    50% deflection will result in the key being  50ms down and 50ms up.
    75% deflection will result in the key being 150ms down and 50ms up.
    etc.
    Minimum interval is 50ms, maximum is 600ms.

diff --git a/src/jstk.c b/src/jstk.c
index a5ea298..155bf2c 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -283,20 +283,9 @@ jstkReadProc(LocalDevicePtr local)
 
             case JSTK_MAPPING_KEY: if (priv->keys_enabled == TRUE) {
                 if (priv->axis[number].type == JSTK_TYPE_ACCELERATED) {
-                    if ((priv->axis[number].value > 0) != 
-                        (priv->axis[number].oldvalue > 0))
-                        jstkGenerateKeys(priv->keyboard_device, 
-                                         priv->axis[number].keys_high,
-                                         (priv->axis[number].value > 0) ? 1:0);
-
-                    if ((priv->axis[number].value < 0) != 
-                        (priv->axis[number].oldvalue < 0))
-                        jstkGenerateKeys(priv->keyboard_device,
-                                         priv->axis[number].keys_low,
-                                         (priv->axis[number].value < 0) ? 1:0);
+                    jstkHandlePWMAxis(local, number);
                 } else if (priv->axis[number].type == JSTK_TYPE_BYVALUE) {
-                    if (priv->keys_enabled == TRUE)
-                        jstkStartAxisTimer(local, number);
+                    jstkStartAxisTimer(local, number);
                 }
                 break;
             }
@@ -449,6 +438,12 @@ jstkDeviceControlProc(DeviceIntPtr       pJstk,
             priv->timerrunning = FALSE;
             TimerCancel(priv->timer);
         }
+        for (i = 0; i < MAXAXES; i++)
+            if (priv->axis[i].timerrunning)
+        {
+            priv->axis[i].timerrunning = FALSE;
+            TimerCancel(priv->axis[i].timer);
+        }
 
         if (local->fd >= 0)
             RemoveEnabledDevice(local->fd);
@@ -552,6 +547,9 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
         priv->axis[i].amplify      = 1.0f;
         priv->axis[i].valuator     = -1;
         priv->axis[i].subpixel     = 0.0f;
+        priv->axis[i].timer        = NULL;
+        priv->axis[i].timerrunning = FALSE;
+        priv->axis[i].key_isdown   = 0;
         for (j=0; j<MAXKEYSPERBUTTON; j++)
             priv->axis[i].keys_low[j] = priv->axis[i].keys_high[j] = 0;
     }
diff --git a/src/jstk.h b/src/jstk.h
index 694ae45..1d97937 100644
--- a/src/jstk.h
+++ b/src/jstk.h
@@ -81,7 +81,11 @@ typedef struct _AXIS {
     float           previousposition; /* TYPE_ABSOLUTE */
     float           amplify;
     float           subpixel; /* Pending subpixel movement */
+
     KEYSCANCODES    keys_low, keys_high;  /* MAPPING_KEY */
+    int             key_isdown;
+    OsTimerPtr      timer;
+    Bool            timerrunning;
 } AXIS;
 
 typedef struct _BUTTON {
diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index 7e59e97..b314122 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -384,3 +384,170 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
         xf86PostMotionEvent(device->dev, 0, 0, 2, x, y);
     }
 }
+
+
+
+
+
+/***********************************************************************
+ *
+ * jstkPWMAxisTimer --
+ *
+ * The timer that will generate Key events.
+ * The deflection of the axis will control the PERCENT OF TIME the key is
+ * down, not the amount of impulses.
+ * Return 0, when timer can be stopped.
+ *
+ ***********************************************************************
+ */
+static CARD32
+jstkPWMAxisTimer(OsTimerPtr        timer,
+                 CARD32            atime,
+                 pointer           arg)
+{
+    DeviceIntPtr          device = (DeviceIntPtr)arg;
+    JoystickDevPtr        priv = (JoystickDevPtr)XI_PRIVATE(device);
+
+    int sigstate, i;
+    int nexttimer;
+
+    nexttimer = 0;
+
+    sigstate = xf86BlockSIGIO();
+
+    for (i=0; i<MAXAXES; i++)
+        if (priv->axis[i].timer == timer) /* The timer handles only one axis! Find it. */
+    {
+        AXIS *axis;
+        axis = &priv->axis[i];
+
+        DBG(8, ErrorF("PWM Axis %d value %d (old %d)\n", i, axis->value, axis->oldvalue));
+
+        /* Force key_high down if centered */
+        if ((axis->value <= 0) && 
+            (axis->oldvalue > 0) &&
+            (axis->key_isdown)) 
+        {
+            DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_high up.\n", i));
+            jstkGenerateKeys(priv->keyboard_device, 
+                axis->keys_high,
+                0);
+            axis->key_isdown = 0;
+        }
+
+        /* Force key_low down if centered */
+        if ((axis->value >= 0) && 
+            (axis->oldvalue < 0) &&
+            (axis->key_isdown))
+        {
+            DBG(7, ErrorF("PWM Axis %d jumped over. Forcing keys_low up.\n", i));
+            jstkGenerateKeys(priv->keyboard_device, 
+                axis->keys_low,
+                0);
+            axis->key_isdown = 0;
+        }
+
+        if (axis->value == 0)
+            nexttimer = 0;
+        else {
+            float time_on, time_off;
+            float scale;
+            KEYSCANCODES *keys;
+
+            if (axis->value < 0)
+                keys = &axis->keys_low;
+            else keys = &axis->keys_high;
+
+            /* Calculate next timer */
+            time_on = (float)(abs(axis->value) - axis->deadzone) / 32768.0;
+            time_on *= (32768.0f / (float)(32768 - axis->deadzone));
+
+            time_off = 1.0f - time_on;
+
+            time_on  += 0.01f; /* Ugly but ensures we don't divide by 0 */
+            time_off += 0.01f;
+
+            /* Scale both durations, so the smaller always is 50ms */
+            scale = 50.0f * axis->amplify;
+
+            if (time_on < time_off)
+                scale /= time_on;
+            else scale /= time_off;
+
+            time_on  *= scale;
+            time_off *= scale;
+
+
+            if (time_off > 600.0f) {
+                /* Might as well just have it down forever */
+                DBG(7, ErrorF("PWM Axis %d up time too long (%.0fms). Forcing up)\n", i, time_off));
+                if (axis->key_isdown == 1) {
+                    axis->key_isdown = 0;
+                    jstkGenerateKeys(priv->keyboard_device,
+                        *keys,
+                        axis->key_isdown);
+                }
+                nexttimer = 0;
+            } else if (time_on > 600.0f) { 
+                /* Might as well just have it up forever */
+                DBG(7, ErrorF("PWM Axis %d down time too long (%.0fms). Forcing down)\n", i, time_on));
+                if (axis->key_isdown == 0) {
+                    axis->key_isdown = 1;
+                    jstkGenerateKeys(priv->keyboard_device,
+                        *keys,
+                        axis->key_isdown);
+                }
+                nexttimer = 0;
+            } else {
+                /* Flip key state */
+                axis->key_isdown = 1 - axis->key_isdown;
+                jstkGenerateKeys(priv->keyboard_device,
+                    *keys,
+                    axis->key_isdown);
+
+                DBG(7, ErrorF("PWM Axis %d state=%d (%.0fms down, %.0fms up).\n", i, axis->key_isdown, time_on, time_off));
+
+                nexttimer = axis->key_isdown ? (int)time_on : (int)time_off;
+            }
+        }
+
+        if (nexttimer == 0) { /* No next timer, stop */
+            axis->timerrunning = FALSE;
+
+            DBG(2, ErrorF("Stopping PWM Axis %d Timer\n", i));
+        }
+        axis->oldvalue = axis->value;
+        break;
+    }
+
+    xf86UnblockSIGIO (sigstate);
+    return nexttimer;
+}
+
+
+/***********************************************************************
+ *
+ * jstkStartAxisTimer --
+ *
+ * Starts the timer for the movement.
+ * Will already prepare for moving one pixel, for "tipping" the stick
+ *
+ ***********************************************************************
+ */
+void
+jstkHandlePWMAxis(LocalDevicePtr device, int number) 
+{
+    JoystickDevPtr priv = device->private;
+    if (priv->axis[number].timerrunning) return;
+
+    priv->axis[number].timerrunning = TRUE;
+
+    DBG(2, ErrorF("Starting PWM Axis Timer (triggered by axis %d, value %d)\n", 
+               number, priv->axis[number].value));
+    priv->axis[number].timer = TimerSet(
+        priv->axis[number].timer, 
+        0,         /* Relative */
+        1,         /* What about NOW? */
+        jstkPWMAxisTimer,
+        device->dev);
+}
diff --git a/src/jstk_axis.h b/src/jstk_axis.h
index e759f39..028c65f 100644
--- a/src/jstk_axis.h
+++ b/src/jstk_axis.h
@@ -27,5 +27,6 @@
 void jstkStartAxisTimer(LocalDevicePtr device, int number);
 void jstkStartButtonAxisTimer(LocalDevicePtr device, int number);
 void jstkHandleAbsoluteAxis(LocalDevicePtr device, int number);
+void jstkHandlePWMAxis(LocalDevicePtr device, int number);
 
 #endif

commit d4bb86ddb0ba570de0f501cd0edb13861456b711
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Thu Feb 19 23:37:46 2009 +0100

    Don't set axis.oldvalue in backend
    
    The value needs to be set where it's needed, like in timers.

diff --git a/src/backend_bsd.c b/src/backend_bsd.c
index cf4cd90..bf3dacb 100644
--- a/src/backend_bsd.c
+++ b/src/backend_bsd.c
@@ -264,7 +264,6 @@ jstkReadData_bsd(JoystickDevPtr joystick,
                          - bsddata->axis_item[j].logical_minimum);
         if (abs(d) < joystick->axis[j].deadzone) d = 0;
         if (d != joystick->axis[j].value) {
-            joystick->axis[j].oldvalue = joystick->axis[j].value;
             joystick->axis[j].value = d;
             if (event != NULL) *event = EVENT_AXIS;
             if (number != NULL) *number = j;
@@ -283,14 +282,12 @@ jstkReadData_bsd(JoystickDevPtr joystick,
         d = hid_get_data(bsddata->data_buf, &bsddata->hat_item[j]) 
             - bsddata->hat_item[j].logical_minimum;
         if (joystick->axis[a].value != v1_data[d]) {
-            joystick->axis[a].oldvalue = joystick->axis[a].value;
             joystick->axis[a].value = v1_data[d];
             if (event != NULL) *event = EVENT_AXIS;
             if (number != NULL) *number = a;
             return 2;
         }
         if (joystick->axis[a+1].value != v2_data[d]) {
-            joystick->axis[a+1].oldvalue = joystick->axis[a+1].value;
             joystick->axis[a+1].value = v2_data[d];
             if (event != NULL) *event = EVENT_AXIS;
             if (number != NULL) *number = a+1;
diff --git a/src/backend_evdev.c b/src/backend_evdev.c
index d03efce..de061d3 100644
--- a/src/backend_evdev.c
+++ b/src/backend_evdev.c
@@ -281,15 +281,11 @@ jstkReadData_evdev(JoystickDevPtr joystick,
                 if (abs(value) < joystick->axis[axis->number].deadzone) {
                     /* We only want one event when in deadzone */
                     if (joystick->axis[axis->number].value != 0) {
-                        joystick->axis[axis->number].oldvalue = 
-                            joystick->axis[axis->number].value;
                         joystick->axis[axis->number].value = 0;
                         if (event != NULL) *event = EVENT_AXIS;
                         if (number != NULL) *number = axis->number;
                     }
                 }else{
-                    joystick->axis[axis->number].oldvalue = 
-                        joystick->axis[axis->number].value;
                     joystick->axis[axis->number].value = value;
                     if (event != NULL) *event = EVENT_AXIS;
                     if (number != NULL) *number = axis->number;
diff --git a/src/backend_joystick.c b/src/backend_joystick.c
index d8a0c3c..b69f932 100644
--- a/src/backend_joystick.c
+++ b/src/backend_joystick.c
@@ -193,15 +193,11 @@ jstkReadData_joystick(JoystickDevPtr joystick,
             if (abs(js.value) < joystick->axis[js.number].deadzone) {
                 /* We only want one event when in deadzone */
                 if (joystick->axis[js.number].value != 0) {
-                    joystick->axis[js.number].oldvalue = 
-                        joystick->axis[js.number].value;
                     joystick->axis[js.number].value = 0;
                     if (event != NULL) *event = EVENT_AXIS;
                     if (number != NULL) *number = js.number;
                 }
             }else{
-                joystick->axis[js.number].oldvalue = 
-                    joystick->axis[js.number].value;
                 joystick->axis[js.number].value = js.value;
                 if (event != NULL) *event = EVENT_AXIS;
                 if (number != NULL) *number = js.number;

commit 4ec4376522b1c393ee44f25adcd28b12d7cadff6
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date:   Tue Feb 17 20:18:05 2009 +0100

    Fix for sparse warning of uninitialized variable
    
    If axis is inside deadzone, 0.0 should be assumed.

diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index 233b2be..7e59e97 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -351,9 +351,11 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
     {
         float rel;
         int dif;
-        if (priv->axis[i].value > priv->axis[i].deadzone)
+        
+    	rel = 0.0f;
+        if (priv->axis[i].value > +priv->axis[i].deadzone)
             rel = (priv->axis[i].value - priv->axis[i].deadzone);
-        else
+        if (priv->axis[i].value < -priv->axis[i].deadzone)
             rel = (priv->axis[i].value + priv->axis[i].deadzone);
 
         rel = (rel) / (2.0f * (float)(32768 - priv->axis[i].deadzone));

commit b70b1f7d827b87ceb63110c781b01175363fb7d0
Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
Date:   Wed Feb 4 18:23:00 2009 -0200

    Janitor: gcc 4.5 and sparse warnings.
    
    It is still required a patch in the X Server sdk to correct some
    remaining warnings. Isn't it amazing that <X11/extensions/XKBsrv.h>
    and $sdkdir/xkbsrv.h both use the #ifndef _XKBSRV_H_ include guard?
    
    Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>

diff --git a/src/jstk.c b/src/jstk.c
index 44acc48..a5ea298 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -519,7 +519,7 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
     local->private = priv;
     local->type_name = XI_JOYSTICK;
     local->history_size = 0;
-    local->always_core_feedback = 0;
+    local->always_core_feedback = NULL;
     local->conf_idev = dev;
 
     priv->fd = -1;
diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index 3c49bd3..233b2be 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -351,9 +351,9 @@ jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
     {
         float rel;
         int dif;
-        if (priv->axis[i].value >= priv->axis[i].deadzone)
+        if (priv->axis[i].value > priv->axis[i].deadzone)
             rel = (priv->axis[i].value - priv->axis[i].deadzone);
-        if (priv->axis[i].value <= -priv->axis[i].deadzone)
+        else
             rel = (priv->axis[i].value + priv->axis[i].deadzone);
 
         rel = (rel) / (2.0f * (float)(32768 - priv->axis[i].deadzone));
diff --git a/src/jstk_key.c b/src/jstk_key.c
index 4e9f710..b2c5b5d 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -34,9 +34,14 @@
 #include <X11/keysym.h>
 #include <X11/XF86keysym.h>
 #include <xf86Optrec.h>
+
 #include "jstk.h"
 #include "jstk_key.h"
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
+#include <xkbsrv.h>
+#endif
+
 #define AltMask		Mod1Mask
 #define NumLockMask	Mod2Mask
 #define AltLangMask	Mod3Mask
@@ -70,7 +75,6 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
     int i, j;
     XkbSrvInfoPtr xkbi;
     XkbControlsPtr ctrls;
-    XkbComponentNamesRec xkbnames;
 
     static struct { KeySym keysym; CARD8 mask; } modifiers[] = {
         { XK_Shift_L,           ShiftMask },
diff --git a/src/jstk_options.c b/src/jstk_options.c
index 309175e..8c0aba1 100644
--- a/src/jstk_options.c
+++ b/src/jstk_options.c
@@ -50,7 +50,7 @@
  ***********************************************************************
  */
 
-int
+static int
 jstkGetKeyNumberInMap(JoystickDevPtr priv,
                       KeySym keysym)
 {

commit 76b82a41a6733ef5a2a89dd370357320ea78792a
Author: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>
Date:   Wed Feb 4 18:10:26 2009 -0200

    Janitor: make distcheck, .gitignore.
    
    The correction for make distcheck uses the same solution proposed
    for xf86-input-evdev, that uses the new configure option --with-sdkdir.
    
    Signed-off-by: Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>

diff --git a/.gitignore b/.gitignore


Reply to: