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

2013-07-21 Thread Julien Cristau
 config/50-joystick-all.conf |7 ++
 configure.ac|8 +-
 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 -
 8 files changed, 198 insertions(+), 75 deletions(-)

New commits:
commit 426c3aa3c8a2385f17e37ae73c1e78f072656027
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Wed Jan 16 10:52:12 2013 +0100

joystick 1.6.2

Signed-off-by: Sascha Hlusiak saschahlus...@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 saschahlus...@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 saschahlus...@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 saschahlus...@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(OsTimerPtrtimer,
 /* 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
+* 
+*   

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

2012-03-20 Thread Cyril Brulebois
 configure.ac  |2 -
 include/joystick-properties.h |2 -
 man/joystick.man  |   31 ---
 src/jstk.c|   22 -
 src/jstk_key.c|   68 +-
 5 files changed, 90 insertions(+), 35 deletions(-)

New commits:
commit bdf8fd3f650789d2012ec0cc915729dd1e91346d
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Mar 11 11:45:08 2012 +0100

joystick 1.6.1

Signed-off-by: Sascha Hlusiak saschahlus...@arcor.de

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

commit b217fabdef1714ed4898e08de4c2a6b9cc8d4f0f
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Nov 13 20:36:07 2011 +0100

Copy pInfo-driver to option list to fix hotplugging of keyboard device

udev does copy the Driver line to the list of options, but when manually
specifying the driver in xorg.conf, the option Driver is unset. Because we
do hotplug a sub-device from within the core device, we need the Driver
option to be present in the list.

This should fix archlinux bug #23577:
  https://bugs.archlinux.org/task/23577

Thanks to Malek for coming up with a fix.

Signed-off-by: Sascha Hlusiak cont...@saschahlusiak.de

diff --git a/src/jstk_key.c b/src/jstk_key.c
index a71275a..241b15d 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -296,6 +296,7 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
 strcat(name,  (keys));
 opts = xf86ReplaceStrOption(opts, Name, name);
 opts = xf86ReplaceStrOption(opts, _source, _driver/joystick);
+opts = xf86AddNewOption(opts, Driver, pInfo-driver);
 
 while(opts)
 {

commit 411c1838456c055d3f911c54ed58bb11a6bf0da3
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Nov 13 18:04:25 2011 +0100

man: valuators are not added automatically

diff --git a/man/joystick.man b/man/joystick.man
index b401de5..9f38ceb 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -129,9 +129,6 @@ can be one of:
 
 .B none, relative, accelerated, absolute
 
-Every axis which's mode is not
-.B none
-will be reported as an additional valuator.
 .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 

commit 7ccf3a75292d71104c976bf6afb389cccaac1a7d
Author: Peter Hutterer peter.hutte...@who-t.net
Date:   Mon Oct 31 14:33:08 2011 +1000

Deal with opaque input option types.

ABI 14 made the InputOption type opaque, move the existing code to ifdefs
and use the new function calls otherwise.

Signed-off-by: Peter Hutterer peter.hutte...@who-t.net
Reviewed-by: Jeremy Huddleston jerem...@apple.com
Reviewed-by: Chase Douglas chase.doug...@canonical.com

diff --git a/src/jstk_key.c b/src/jstk_key.c
index e842941..a71275a 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -247,13 +247,46 @@ int jstkKeyboardPreInit(InputDriverPtr drv, InputInfoPtr 
pInfo, int flags)
 return Success;
 }
 
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION)  14
+static InputOption*
+input_option_new(InputOption* list, char *key, char *value)
+{
+InputOption *tmp;
+
+tmp = calloc(1, sizeof(*tmp));
+tmp-key = key;
+tmp-value = value;
+tmp-next = list;
+
+return tmp;
+}
+
+static void
+input_option_free_list(InputOption **list)
+{
+InputOption *iopts = *list;
+
+while(iopts)
+{
+InputOption *tmp = iopts-next;
+free(iopts-key);
+free(iopts-value);
+free(iopts);
+iopts = tmp;
+}
+
+*list = NULL;
+}
+
+#endif
+
 InputInfoPtr
 jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
 {
 int rc;
 char name[512] = {0};
 InputAttributes *attrs = NULL;
-InputOption *iopts = NULL, *tmp;
+InputOption *iopts = NULL;
 DeviceIntPtr dev;
 XF86OptionPtr opts;
 
@@ -266,12 +299,9 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
 
 while(opts)
 {
-tmp = calloc(1, sizeof(InputOption));
-
-tmp-key = xf86OptionName(opts);
-tmp-value = xf86OptionValue(opts);
-tmp-next = iopts;
-iopts = tmp;
+iopts = input_option_new(iopts,
+ xf86OptionName(opts),
+ xf86OptionValue(opts));
 opts = xf86NextOption(opts);
 }
 
@@ -280,14 +310,7 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
 
 rc = NewInputDeviceRequest(iopts, attrs, dev);
 
-while(iopts)
-{
-tmp = iopts-next;
-free(iopts-key);
-

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

2011-04-28 Thread Julien Cristau
 .gitignore  |   78 +--
 COPYING |   49 +++-
 Makefile.am |   10 
 config/50-joystick-all.conf |   51 
 config/Makefile.am  |2 
 configure.ac|  126 +--
 include/Makefile.am |2 
 man/Makefile.am |   62 +
 man/joystick.man|   47 +---
 src/Makefile.am |3 
 src/backend_bsd.c   |1 
 src/backend_evdev.c |1 
 src/backend_joystick.c  |1 
 src/jstk.c  |  319 +
 src/jstk.h  |   13 -
 src/jstk_axis.c |   15 -
 src/jstk_axis.h |8 
 src/jstk_key.c  |  482 ++--
 src/jstk_key.h  |9 
 src/jstk_options.c  |5 
 src/jstk_properties.c   |7 
 21 files changed, 505 insertions(+), 786 deletions(-)

New commits:
commit bd6c54fe672a913334bfba1ca5dc0f2e0f1f1152
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Wed Apr 20 20:55:24 2011 +0200

joystick 1.6.0

Signed-off-by: Sascha Hlusiak saschahlus...@arcor.de

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

commit f1b8ef560049f1bb1bca9caa12c1529c9f992a09
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Wed Apr 20 20:48:28 2011 +0200

Updated man page to reflect latest changes

diff --git a/man/joystick.man b/man/joystick.man
index 97e3ba3..da92ceb 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -4,14 +4,19 @@
 .SH NAME
 joystick \- Joystick input driver
 .SH SYNOPSIS
+Snipped for xorg.conf.d(5):
+
 .nf
-.B Section \*qInputDevice\*q
-.BI   Identifier \*q devname \*q
-.BDriver \*qjoystick\*q
-.BI   Option \*qDevice\*q   \*q devpath \*q
+.B Section \*qInputClass\*q
+.BI   Identifier \*q joystick-all \*q
+.BIDriver \*q joystick \*q
+.BI   Option \*qMatchIsJoystick\*q   \*q on \*q
+.BI   Option \*qMatchDevicePath \*q /dev/input/event* \*q
 \ \ ...
 .B EndSection
 .fi
+
+
 .SH DESCRIPTION
 .B joystick
 is an __xservername__ input driver for Joysticks. There are 3 backends 
available that are used in the following order, if support was found:
@@ -314,33 +319,21 @@ The keys for the first two axes will be generated in an 
interval according to th
 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 NOTES
-The driver does not do hotplugging on it's own. The joystick needs to be 
plugged in when the driver is loaded.
-If the joystick is unplugged, the device will be automatically deactivated.
-.P
-There is an example hal policy in
+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 
+.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
-which will take care of hotplugging. Place it in
-.I /etc/hal/fdi/policy 
-and customize it to your needs. Pass custom options to the driver using 
x11_options properties. This requires xorg-server-1.5 or 
-higher.
-.P
-Make sure you add the 
-.I \*qSendCoreEvents\*q
-keyword to the device entry of your
-.B ServerLayout
-section of the 
-.I xorg.conf
-file, otherwise the device won't report core pointer and core key events.
-
-Example: 
-.nf
-.BI InputDevice  \*qJoystick1\*q \*qSendCoreEvents\*q
-.fi
+to be placed in
+.IR /etc/hal/fdi/policy .
 
 
 .SH SEE ALSO
-__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), 
Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
+__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), 
xorg.conf.d(5), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
 .SH AUTHORS
-Sascha Hlusiak (2007-2009),
+Sascha Hlusiak (2007-2011),
 .fi
 Frederic Lepied (1995-1999)

commit aa78e01edabb27d1b5dcd4ffe2be32878a45e342
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Wed Apr 20 20:47:33 2011 +0200

Added xorg.conf.d example snipped

Not installed by default, left for distributors.

Copy 50-joystick-all.conf to /etc/X11/xorg.conf.d/ and modify to your needs.

diff --git a/config/50-joystick-all.conf b/config/50-joystick-all.conf
new file mode 100644
index 000..ee03dd5
--- /dev/null
+++ b/config/50-joystick-all.conf
@@ -0,0 +1,51 @@
+# Example xorg.conf.d snippet that 

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

2009-11-30 Thread Timo Aaltonen
Rebased ref, commits from common ancestor:
commit eaf8d1a1d87af9f67ca3e3d0436bb9d9a7cfc17a
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sat Oct 31 12:41:15 2009 +0100

Bump to 1.5.0

Signed-off-by: Sascha Hlusiak saschahlus...@arcor.de

diff --git a/configure.ac b/configure.ac
index 3402d02..e0be568 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-joystick],
-1.4.99.2,
+1.5.0,
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 xf86-input-joystick)
 

commit 657c01c8ebb9e0571d498356e6d3d03917199328
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Wed Oct 7 09:24:39 2009 +0200

Revert add shave support

This reverts commit 1fa414dd6f32d68378bc9d571c439a603c2e7888.

diff --git a/.gitignore b/.gitignore
index 443e330..e5a79a1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,5 +26,3 @@ xf86-input-joystick-*.tar.gz
 ChangeLog
 *.pc
 tags
-shave
-shave-libtool
diff --git a/acinclude.m4 b/acinclude.m4
deleted file mode 100644
index 0a3509e..000
--- a/acinclude.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-dnl Make automake/libtool output more friendly to humans
-dnl  Damien Lespiau damien.lesp...@gmail.com
-dnl
-dnl SHAVE_INIT([shavedir],[default_mode])
-dnl
-dnl shavedir: the directory where the shave scripts are, it defaults to
-dnl   $(top_builddir)
-dnl default_mode: (enable|disable) default shave mode.  This parameter
-dnl   controls shave's behaviour when no option has been
-dnl   given to configure.  It defaults to disable.
-dnl
-dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
-dnl   before AC_CONFIG_FILE/AC_OUTPUT is perfect.  This macro rewrites CC and
-dnl   LIBTOOL, you don't want the configure tests to have these variables
-dnl   re-defined.
-dnl * This macro requires GNU make's -s option.
-
-AC_DEFUN([_SHAVE_ARG_ENABLE],
-[
-  AC_ARG_ENABLE([shave],
-AS_HELP_STRING(
-  [--enable-shave],
-  [use shave to make the build pretty [[default=$1]]]),,
-  [enable_shave=$1]
-)
-])
-
-AC_DEFUN([SHAVE_INIT],
-[
-  dnl you can tweak the default value of enable_shave
-  m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)])
-
-  if test x$enable_shave = xyes; then
-dnl where can we find the shave scripts?
-m4_if([$1],,
-  [shavedir=$ac_pwd],
-  [shavedir=$ac_pwd/$1])
-AC_SUBST(shavedir)
-
-dnl make is now quiet
-AC_SUBST([MAKEFLAGS], [-s])
-AC_SUBST([AM_MAKEFLAGS], ['`test -z $V  echo -s`'])
-
-dnl we need sed
-AC_CHECK_PROG(SED,sed,sed,false)
-
-dnl substitute libtool
-SHAVE_SAVED_LIBTOOL=$LIBTOOL
-LIBTOOL=${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'
-AC_SUBST(LIBTOOL)
-
-dnl substitute cc/cxx
-SHAVE_SAVED_CC=$CC
-SHAVE_SAVED_CXX=$CXX
-SHAVE_SAVED_FC=$FC
-SHAVE_SAVED_F77=$F77
-SHAVE_SAVED_OBJC=$OBJC
-CC=${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}
-CXX=${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}
-FC=${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}
-F77=${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}
-OBJC=${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}
-AC_SUBST(CC)
-AC_SUBST(CXX)
-AC_SUBST(FC)
-AC_SUBST(F77)
-AC_SUBST(OBJC)
-
-V=@
-  else
-V=1
-  fi
-  Q='$(V:1=)'
-  AC_SUBST(V)
-  AC_SUBST(Q)
-])
-
diff --git a/configure.ac b/configure.ac
index 63f3f7e..3402d02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,8 +32,6 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_MAINTAINER_MODE
 
-AC_CONFIG_FILES([shave shave-libtool])
-
 # Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
 m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or 
later before running autoconf/autogen])])
 XORG_MACROS_VERSION(1.2)
@@ -123,8 +121,6 @@ XORG_MANPAGE_SECTIONS
 XORG_RELEASE_VERSION
 XORG_CHANGELOG
 
-SHAVE_INIT([.], [enable])
-
 AC_OUTPUT([Makefile
src/Makefile
man/Makefile
diff --git a/shave-libtool.in b/shave-libtool.in
deleted file mode 100644
index 1f3a720..000
--- a/shave-libtool.in
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-# we need sed
-s...@sed@
-if test -z $SED ; then
-SED=sed
-fi
-
-lt_unmangle ()
-{
-   last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
-}
-
-# the real libtool to use
-LIBTOOL=$1
-shift
-
-# if 1, don't print anything, the underlaying wrapper will do it
-pass_though=0
-
-# scan the arguments, keep the right ones for libtool, and discover the mode
-preserved_args=
-while test $# -gt 0; do
-opt=$1
-shift
-
-case $opt in
---mode=*)
-mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
-preserved_args=$preserved_args $opt
-;;
--o)
-lt_output=$1
-preserved_args=$preserved_args $opt
-   ;;
-*)
-preserved_args=$preserved_args $opt
-;;
-  esac
-done
-
-case $mode in
-compile)
-# 

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

2009-04-15 Thread Brice Goglin
 .gitignore|4 
 Makefile.am   |8 -
 README|   20 
 configure.ac  |   26 --
 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 ++--
 19 files changed, 330 insertions(+), 64 deletions(-)

New commits:
commit 88a084952f547ebc2f30a257e441930024a69be9
Author: Sascha Hlusiak saschahlus...@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 saschahlus...@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 saschahlus...@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; ival-size; i++) {
 if (values[i]  BUTTONMAP_SIZE) {
DBG(1, ErrorF(Button number out of range (0..%d): %d\n,

commit bc430cc2aacdcda45ddc38d457b84ff040be6a8c
Author: Sascha Hlusiak saschahlus...@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; jMAXKEYSPERBUTTON; j++)
 priv-button[i].keys[j] = 0;
 }

commit 4b9aafd82bf78e86b2b2ddc78c37d73ccc7c25d5
Author: Sascha Hlusiak saschahlus...@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 saschahlus...@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 

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

2009-04-09 Thread Julien Cristau
 .gitignore   |2 
 Makefile.am  |7 
 config/50-x11-input-joystick.fdi |   41 
 configure.ac |   18 +-
 include/Makefile.am  |   23 ++
 include/joystick-properties.h|  123 +
 man/joystick.man |   25 +-
 src/Makefile.am  |3 
 src/backend_bsd.c|   44 ++--
 src/backend_bsd.h|6 
 src/backend_evdev.c  |   27 ++-
 src/backend_evdev.h  |6 
 src/backend_joystick.c   |   26 ++
 src/backend_joystick.h   |6 
 src/jstk.c   |  224 +++--
 src/jstk.h   |   51 ++---
 src/jstk_axis.c  |   83 -
 src/jstk_axis.h  |1 
 src/jstk_key.c   |  180 ++--
 src/jstk_key.h   |4 
 src/jstk_options.c   |   88 -
 src/jstk_options.h   |3 
 src/jstk_properties.c|  347 +++
 src/jstk_properties.h|   31 +++
 xorg-joystick.pc.in  |7 
 25 files changed, 1079 insertions(+), 297 deletions(-)

New commits:
commit 43e2f0526894cb5eacac8730a21ccdf415421d72
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Dec 28 18:57:36 2008 +0100

Prepare for 1.4.0 release

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

commit fd80f1c2b5b91e0260dc28e9b5e259025ea379e5
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Dec 28 17:32:44 2008 +0100

Matched comments in joystick-properties.h with previous commit

diff --git a/include/joystick-properties.h b/include/joystick-properties.h
index 603394d..8dc5447 100644
--- a/include/joystick-properties.h
+++ b/include/joystick-properties.h
@@ -82,11 +82,11 @@ typedef enum _JSTK_MAPPING {
 #define JSTK_PROP_AXIS_DEADZONE   Axis Deadzone
 
 /** Set axis type to none, byvalue, accelerated, absolute */
-/* 8 bit, one of enum _JOYSTICKTYPE @ jstk.h per axis*/
+/* 8 bit, one of enum _JSTK_TYPE per axis*/
 #define JSTK_PROP_AXIS_TYPE   Axis Type
 
 /** Set mapping of axis to none, x, y, zx, zy, key */
-/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per axis */
+/* 8 bit, one of enum _JSTK_MAPPING per axis */
 #define JSTK_PROP_AXIS_MAPPING   Axis Mapping
 
 /** Set movement factor of axis (default 1.0f) */
@@ -104,7 +104,7 @@ typedef enum _JSTK_MAPPING {
 /** Set the mapping of each button to
 none, x, y, zx, zy, button, key, speed_multiply,
 disable, disable_mouse, disable_keys */
-/* 8 bit, one of enum _JOYSTICKMAPPING @ jstk.h per button */
+/* 8 bit, one of enum _JSTK_MAPPING per button */
 #define JSTK_PROP_BUTTON_MAPPING   Button Mapping
 
 /** Set the logical button to report for this physical button */

commit f81b9077d13b614262556a7401068f016fe2b365
Author: Sascha Hlusiak saschahlus...@arcor.de
Date:   Sun Dec 28 17:28:50 2008 +0100

Export JSTK_* constants with joystick-properties.h

diff --git a/include/joystick-properties.h b/include/joystick-properties.h
index 178df26..603394d 100644
--- a/include/joystick-properties.h
+++ b/include/joystick-properties.h
@@ -30,6 +30,33 @@
  */
 
 
+
+/** To be used with property JSTK_PROP_AXIS_TYPE **/
+typedef enum _JSTK_TYPE {
+JSTK_TYPE_NONE=0,  /* Axis value is not relevant */
+JSTK_TYPE_BYVALUE, /* Speed of cursor is relative to amplitude */
+JSTK_TYPE_ACCELERATED, /* Speed is accelerated */
+JSTK_TYPE_ABSOLUTE /* The amplitude defines the cursor position */
+} JSTK_TYPE;
+
+
+/** To be used with properties JSTK_PROP_AXIS_MAPPING, 
JSTK_PROP_BUTTON_MAPPING */
+typedef enum _JSTK_MAPPING {
+JSTK_MAPPING_NONE=0, /* Nothing */
+JSTK_MAPPING_X,  /* X-Axis */
+JSTK_MAPPING_Y,  /* Y-Axis */
+JSTK_MAPPING_ZX, /* Horizontal scrolling */
+JSTK_MAPPING_ZY, /* Vertical scrolling */
+JSTK_MAPPING_BUTTON, /* Mouse button */
+JSTK_MAPPING_KEY,/* Keyboard event */
+JSTK_MAPPING_SPEED_MULTIPLY, /* Will amplify all axis movement */
+JSTK_MAPPING_DISABLE,/* Disable mouse and key events */
+JSTK_MAPPING_DISABLE_MOUSE,  /* Disable only mouse events */
+JSTK_MAPPING_DISABLE_KEYS/* Disable only key events */
+} JSTK_MAPPING;
+
+
+
 /** Controls the verbosity of the driver */
 /* 8 bit (0..20) */
 #define JSTK_PROP_DEBUGLEVEL Debug Level
diff --git a/src/jstk.h b/src/jstk.h
index 3e8d891..694ae45 100644
--- a/src/jstk.h
+++ b/src/jstk.h
@@ -26,6 +26,7 @@
 
 #include xf86Xinput.h
 #include X11/extensions/XIproto.h
+#include joystick-properties.h /* definitions */
 
 
 

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

2008-05-17 Thread Brice Goglin
 configure.ac   |2 -
 man/Makefile.am|1 
 man/joystick.man   |   66 +++--
 src/StrKeysym.h|   22 
 src/backend_bsd.c  |2 -
 src/backend_bsd.h  |2 -
 src/backend_evdev.c|8 ++---
 src/backend_evdev.h|2 -
 src/backend_joystick.c |2 -
 src/backend_joystick.h |2 -
 src/jstk.c |   11 +---
 src/jstk.h |4 +-
 src/jstk_axis.c|2 -
 src/jstk_axis.h|2 -
 src/jstk_key.c |   11 +---
 src/jstk_key.h |2 -
 src/jstk_options.c |9 --
 src/jstk_options.h |2 -
 18 files changed, 102 insertions(+), 50 deletions(-)

New commits:
commit 0961ffa84825f3f32d9c973f054400ab9d2b7c08
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Apr 27 19:16:29 2008 +0200

Bumped to version 1.3.2

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

commit c3e3fb8795c19a292ca37ab4d67b308fbb20911b
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Wed Apr 9 15:09:46 2008 +0200

Display evdev bus/vendor/product/version in separate line

diff --git a/src/backend_evdev.c b/src/backend_evdev.c
index 5f34394..231bc2d 100644
--- a/src/backend_evdev.c
+++ b/src/backend_evdev.c
@@ -176,9 +176,9 @@ jstkOpenDevice_evdev(JoystickDevPtr joystick)
 if (ioctl(joystick-fd, EVIOCGUNIQ(sizeof(uniq)), uniq) == -1)
 strcpy(uniq, No name);
 
-xf86Msg(X_INFO, Joystick: %s. %d axes, %d buttons.\n, name, axes, 
buttons);
-xf86Msg(X_INFO, Joystick: bus 0x%x vendor 0x%x product 0x%x version 
0x%x\n,
-id.bustype, id.vendor, id.product, id.version);
+xf86Msg(X_INFO, Joystick: %s. bus 0x%x vendor 0x%x product 0x%x version 
0x%x\n,
+   name, id.bustype, id.vendor, id.product, id.version);
+xf86Msg(X_INFO, Joystick: found %d axes, %d buttons\n, axes, buttons);
 
 joystick-read_proc = jstkReadData_evdev;
 joystick-close_proc = jstkCloseDevice_evdev;

commit edcc8c26dfa3f89672a66c47665d89c7c9200b13
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Mar 30 13:21:22 2008 +0200

Fixed keymap size to 8-256 to prevent crash

Newer xservers don't like keymaps that are smaller than 248 keys.

diff --git a/src/jstk.h b/src/jstk.h
index e6c22c0..c2cef9d 100644
--- a/src/jstk.h
+++ b/src/jstk.h
@@ -127,7 +127,7 @@ typedef struct _JoystickDevRec {
 } buttonmap;
 struct _KEYMAP {
 int size;
-KeySym map[MAP_LENGTH];
+KeySym map[256-MIN_KEYCODE];
 } keymap;
 
 AXIS axis[MAXAXES];   /* Configuration per axis */
diff --git a/src/jstk_key.c b/src/jstk_key.c
index 42492c4..a9a6e0d 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -70,8 +70,12 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
 
 DBG(1, xf86Msg(X_CONFIG, Initializing Keyboard with %d keys\n,
priv-keymap.size));
+for (i = 0; i  priv-keymap.size; i++)
+{
+   DBG(6, xf86Msg(X_CONFIG, Keymap [%d]: 0x%08X\n, 
MIN_KEYCODE+i,priv-keymap.map[i]));
+}
 
-memset(modMap, 0, sizeof modMap);
+memset(modMap, 0, sizeof(modMap));
 
 for (i = 0; i  priv-keymap.size; i++) {
 sym = priv-keymap.map[i];
@@ -84,7 +88,8 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
 keySyms.map= priv-keymap.map;
 keySyms.mapWidth   = 1;
 keySyms.minKeyCode = MIN_KEYCODE;
-keySyms.maxKeyCode = MIN_KEYCODE + priv-keymap.size - 1;
+/*keySyms.maxKeyCode = MIN_KEYCODE + priv-keymap.size - 1; */
+keySyms.maxKeyCode = MIN_KEYCODE + 
sizeof(priv-keymap.map)/sizeof(priv-keymap.map[0]) - 1;
 
 for (i = 0; i  priv-keymap.size; i++) {
 sym = priv-keymap.map[i];
diff --git a/src/jstk_options.c b/src/jstk_options.c
index 24912b5..510c160 100644
--- a/src/jstk_options.c
+++ b/src/jstk_options.c
@@ -83,7 +83,7 @@ jstkGetKeyNumberInMap(JoystickDevPtr priv,
 for (j=0; jpriv-keymap.size; j++)
 if (priv-keymap.map[j] == keysym)
 break;
-if (j  MAP_LENGTH+1) return 0;
+if (j = sizeof(priv-keymap.map)/sizeof(priv-keymap.map[0])) return 0;
 priv-keymap.map[j] = keysym;
 if (j + 1  priv-keymap.size) priv-keymap.size = j + 1;
 return j;

commit fac2c42a01cf030a05d2305a01700f3677f6a8dc
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Mar 30 13:05:35 2008 +0200

Clear complete keymap instead of only the first element

diff --git a/src/jstk.c b/src/jstk.c
index 73d41b4..a77f0ae 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -481,7 +481,7 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 priv-amplify = 1.0f;
 priv-buttonmap.size = 0;
 priv-keymap.size = 1;
-priv-keymap.map[0] = NoSymbol;
+

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

2007-12-08 Thread Brice Goglin
 Makefile.am  |2 
 config/50-x11-input-joystick.fdi |   16 ++
 config/Makefile.am   |1 
 configure.ac |   60 ---
 man/joystick.man |   25 ++-
 src/Makefile.am  |   15 +
 src/backend_bsd.c|  309 +++
 src/backend_bsd.h|   35 
 src/backend_evdev.c  |  294 +
 src/backend_evdev.h  |   35 
 src/backend_joystick.c   |  197 
 src/backend_joystick.h   |   35 
 src/bsd_jstk.c   |  308 --
 src/jstk.c   |   66 +++-
 src/jstk.h   |   16 +-
 src/jstk_hw.h|   38 
 src/jstk_key.c   |1 
 src/jstk_options.c   |1 
 src/linux_jstk.c |  195 
 19 files changed, 1066 insertions(+), 583 deletions(-)

New commits:
commit 01637abd2b059923f5c41ab80c80ab93579cbe9b
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Fri Dec 7 00:17:56 2007 +0100

Mentioned hotplugging and hal policy in man page

diff --git a/man/joystick.man b/man/joystick.man
index 786228b..8e48883 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -42,12 +42,14 @@ The following Driver
 are supported:
 .TP 7
 .BI Option \*qDevice\*q \*q string \*q
+.TP 7
+.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
 .IR /dev/input/jsX  or  /dev/input/eventX .
 
-For *BSD, joysticks are recognized as 
+In *BSD, joysticks are usually recognized as 
 .IR /dev/uhidX .
 .TP 7
 .BI Option \*qDebugLevel\*q \*q integer \*q
@@ -292,9 +294,15 @@ Axes in the mode
 will be ignored. The mode has no effect on the reported value. The axis does 
not need to be assigned to a direction.
 
 .SH NOTES
-The driver does not do hotplugging. The joystick needs to be plugged in when 
the driver is loaded.
+The driver does not do hotplugging on it's own. The joystick needs to be 
plugged in when the driver is loaded.
 If the joystick is unplugged, the device will be deactivated.
 .P
+There is an example hal policy in
+.I ${sourcecode}/config/50-x11-input-joystick.fdi
+which will take care of hotplugging. Place it in
+.I /etc/hal/fdi/policy 
+and customize it to your needs. This is highly experimental and for now you 
can't pass options to the driver.
+.P
 Make sure you add the 
 .I \*qSendCoreEvents\*q
 keyword to the device entry of your

commit 47cd8141f9bf3e69d5418f3b5f448366f500cf0d
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Thu Dec 6 23:55:20 2007 +0100

Bumped to version 1.3.1

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

commit c463776b8b35e6e721128a7348e088d306c4ee02
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Thu Dec 6 23:48:49 2007 +0100

Added example hal policy file for input hotplugging of joysticks

Hal policy config/50-x11-input-joystick.fdi is not installed by default and 
you probably
don't want to.

diff --git a/Makefile.am b/Makefile.am
index af2effb..6bef39a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,7 +19,7 @@
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src man
+SUBDIRS = src man config
 
 EXTRA_DIST = autogen.sh ChangeLog
 
diff --git a/config/50-x11-input-joystick.fdi b/config/50-x11-input-joystick.fdi
new file mode 100644
index 000..f32a36a
--- /dev/null
+++ b/config/50-x11-input-joystick.fdi
@@ -0,0 +1,16 @@
+?xml version=1.0 encoding=ISO-8859-1?
+deviceinfo version=0.2
+  device
+match key=info.capabilities contains=input
+  !-- Match on anything you like from lshal --
+  match key=input.product string=Logitech Logitech Dual Action
+!-- Currently Xorg looks for these two capabilities, so
+ we need to add them. This might confuse other hal clients. --
+append key=info.capabilities type=strlistinput.keys/append 
+append key=info.capabilities type=strlistinput.mouse/append
+merge key=input.x11_driver type=stringjoystick/merge
+!-- How to add custom parameters to configure the device? --
+  /match
+/match
+  /device
+/deviceinfo
diff --git a/config/Makefile.am b/config/Makefile.am
new file mode 100644
index 000..c96ffeb
--- /dev/null
+++ b/config/Makefile.am
@@ -0,0 +1 @@
+EXTRA_DIST = 50-x11-input-joystick.fdi
diff --git a/configure.ac b/configure.ac
index 4660213..a511b83 100644
--- a/configure.ac
+++ 

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

2007-10-28 Thread Drew Parsons
 configure.ac   |4 
 man/joystick.man   |   71 -
 src/Makefile.am|8 
 src/StrKeysym.c|   82 +
 src/StrKeysym.h|6 
 src/jstk.c |   47 
 src/jstk.h |5 
 src/jstk_axis.c|   32 
 src/jstk_key.c |  150 ++
 src/jstk_key.h |   31 
 src/jstk_options.c |   90 +
 src/jstk_options.h |3 
 src/ks_tables.h| 2694 +
 13 files changed, 3137 insertions(+), 86 deletions(-)

New commits:
commit c9e359fda611778da578f3699b8f2f4c9122852c
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sat Oct 27 18:50:08 2007 +0200

Added missing headerfiles to Makefile.am

Files StrKeysym.h and ks_tables.h were missing. Sorry, guys.

diff --git a/src/Makefile.am b/src/Makefile.am
index de208e0..d9fc76a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,7 @@
jstk_axis.c jstk_axis.h \
jstk_key.c jstk_key.h \
jstk_options.c jstk_options.h \
-   StrKeysym.c
+   StrKeysym.c StrKeysym.h ks_tables.h
 
 BSD_SRCS   = bsd_jstk.c
 LINUX_SRCS = linux_jstk.c

commit 8668189c26956922a9a10a80289162cfd5741bdf
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sat Oct 27 15:38:09 2007 +0200

Debug output of AutoRepeat option

diff --git a/src/jstk.c b/src/jstk.c
index 8095bc3..c041d12 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -533,6 +533,8 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 if (rate != 0)
 priv-repeat_interval = 1000/rate;
 else priv-repeat_interval = 0;
+DBG(1, xf86Msg(X_CONFIG, Autorepeat set to delay=%d, 
interval=%d\n,
+   priv-repeat_delay,priv-repeat_interval));
 }
 xfree(s);
 }

commit 68e4850b28c34d8e7a41fe2682a115183e3a22d4
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Wed Oct 10 18:00:59 2007 +0200

Added AutoRepeat option to specify rate and delay for key events.

So far the autorepeat settings of xorg were used, thus sharing the settings 
with all other keyboard. This is still the default but the
rate and delay can be changed per device, not conflicting with the settings 
of other keyboards.

diff --git a/man/joystick.man b/man/joystick.man
index 06fb29f..cd08098 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -48,6 +48,13 @@ If compiled with debugging information, controls the 
verbosity of the driver.
 The higher the DebugLevel, the more output is produced.
 Default: 0
 .TP 7
+.BI Option \*qAutoRepeat\*q \*q delay rate \*q
+Sets the auto repeat behaviour for key events.
+.I delay
+is the time in milliseconds before a key starts repeating.
+.I rate
+is the number of times a key repeats per second.  Default: Xorg default
+.TP 7
 .BI Option \*qMapButtonnumber\*q \*q string \*q
 Sets the mapping of the joystick button to the desired action. Counting of 
buttons starts with 
 .IR 1 ,
diff --git a/src/jstk.c b/src/jstk.c
index 8ae506d..8095bc3 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -436,6 +436,8 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 priv-buttonmap.size = 0;
 priv-keymap.size = 1;
 priv-keymap.map[0] = NoSymbol;
+priv-repeat_delay = 0;
+priv-repeat_interval = 0;
 
 /* Initialize default mappings */
 for (i=0; iMAXAXES; i++) {
@@ -520,6 +522,20 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 }
 #endif
 
+/* Parse option for autorepeat */
+if ((s = xf86SetStrOption(dev-commonOptions, AutoRepeat, NULL))) {
+int delay, rate;
+if (sscanf(s, %d %d, delay, rate) != 2) {
+xf86Msg(X_ERROR, %s: \%s\ is not a valid AutoRepeat value, 
+local-name, s);
+} else {
+priv-repeat_delay = delay;
+if (rate != 0)
+priv-repeat_interval = 1000/rate;
+else priv-repeat_interval = 0;
+}
+xfree(s);
+}
 
 /* Process button mapping options */
 for (i=0; iMAXBUTTONS; i++) {
diff --git a/src/jstk.h b/src/jstk.h
index e74115d..b0cd616 100644
--- a/src/jstk.h
+++ b/src/jstk.h
@@ -104,6 +104,8 @@ typedef struct _JoystickDevRec {
 Bool mouse_enabled, keys_enabled;
 floatamplify; /* Global amplifier of axis movement */
 
+int  repeat_delay, repeat_interval; /* Key autorepeat */
+
 struct _BUTTONMAP {
 int size;
 CARD8 scrollbutton[4]; /* Logical button numbers for scrollwheel */
diff --git a/src/jstk_key.c b/src/jstk_key.c
index aa14438..5cddf25 100644
--- a/src/jstk_key.c
+++ b/src/jstk_key.c
@@ -34,7 +34,6 @@
 #include X11/extensions/XKBsrv.h
 #include X11/keysym.h
 #include X11/XF86keysym.h
-// #include xf86Xinput.h
 #include jstk.h
 #include jstk_key.h
 
@@ -52,6 +51,8 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
 KeySym sym;
 int i, j;
  

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

2007-08-16 Thread Brice Goglin
 .gitignore |2 
 ChangeLog  |   51 
 Makefile.am|   11 
 configure.ac   |   14 +
 man/.gitignore |2 
 man/joystick.man   |   96 +++-
 src/bsd_jstk.c |  371 
 src/jstk.c |  599 -
 src/jstk.h |   67 ++---
 src/jstk_axis.c|  537 ++-
 src/jstk_axis.h|1 
 src/jstk_options.c |  326 +---
 src/jstk_options.h |9 
 src/linux_jstk.c   |  180 ---
 14 files changed, 1254 insertions(+), 1012 deletions(-)

New commits:
commit 13c850fe77b0a9a8a719bedfa1439e96972a730b
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Aug 12 13:01:16 2007 +0200

configure.ac: prepared for 1.2.3 release

diff --git a/configure.ac b/configure.ac
index 76e0e10..88b5315 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-input-joystick],
-1.2.2,
+1.2.3,
 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 xf86-input-joystick)
 

commit 3651cc8ee6257a5c8f098c603b892aff45ee1e68
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Aug 12 12:49:59 2007 +0200

Added --enable-debug option to configure script

The options --enable-debug and --disable-debug control if additional 
debugging messages shall be included in the binary, that can made
visible with the DebugLevel option in the xorg.conf. Default: Enabled.

diff --git a/configure.ac b/configure.ac
index f6653bb..76e0e10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,18 @@ AC_ARG_WITH(xorg-module-dir,
[[default=$libdir/xorg/modules]]]),
 [moduledir=$withval],
 [moduledir=$libdir/xorg/modules])
+
+AC_ARG_ENABLE(debug,
+AS_HELP_STRING([--enable-debug],
+   [Enable debugging (default: enabled)]),
+  [DEBUGGING=$enableval], [DEBUGGING=yes])
+if test x$DEBUGGING = xyes; then
+AC_DEFINE(DEBUG, 1, [Enable debugging code])
+else
+AC_DEFINE(NDEBUG, 1, [Disable some debugging code])
+fi
+AM_CONDITIONAL(DEBUG, [test x$DEBUGGING = xyes])
+
 inputdir=${moduledir}/input
 AC_SUBST(inputdir)
 
diff --git a/src/jstk.c b/src/jstk.c
index 4be8fbe..a15985d 100644
--- a/src/jstk.c
+++ b/src/jstk.c
@@ -499,7 +499,7 @@ jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
 }
 #else
 if (xf86SetIntOption(dev-commonOptions, DebugLevel, 0) != 0) {
-xf86Msg(X_WARNING, %s: DebugLevel: Compiled without Debug 
support!\n, 
+xf86Msg(X_WARNING, %s: DebugLevel: Compiled without debugging 
support!\n, 
 local-name);
 }
 #endif
diff --git a/src/jstk.h b/src/jstk.h
index 7a9293c..d17f5af 100644
--- a/src/jstk.h
+++ b/src/jstk.h
@@ -37,17 +37,8 @@
 #undef DBG
 #endif
 
-#ifdef DEBUG
-#undef DEBUG
-#endif
-#define DEBUG 1
-
-/**
- * DEBUG Makros
- **/
-
 #if DEBUG
-extern int  debug_level;
+extern int debug_level;
 #define DBG(lvl, f) {if ((lvl) = debug_level) f;}
 #else
 #define DBG(lvl, f)

commit ca6968c1800ed30aec78b1e474c2b0ede77cd301
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Sun Aug 12 00:04:35 2007 +0200

Explained new key generation features for axes in man page.

Explained the behaviour of accelerated vs relative axes that are mapped to 
keys. Added example to man page.

diff --git a/man/joystick.man b/man/joystick.man
index 0544d82..0fcda91 100644
--- a/man/joystick.man
+++ b/man/joystick.man
@@ -116,7 +116,7 @@ will be reported as an additional valuator.
 Where
 .I axis
 is one of:
-.B X, Y, ZX, ZY
+.B X, Y, ZX, ZY, KEY (see keylow/keyhigh)
 
 and 
 .I factor
@@ -128,18 +128,26 @@ Negative values will invert the movement. Default: 1.0
 .TP 7
 .BI \*qkeyhigh=keycode[,keycode[,keycode[,keycode]]]
 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 keycodes for each 
direction. The behaviour is not changed by the specified
-.BR mode ,
-the value in
-.B axis
-is ignored.
+to the direction of the movement is generated. When the axis is released, 
keyup events will be generated. You can specify up to 4 keycodes for each 
direction. 
 
 .B keylow
 defines the keys to be generated when the axis is moved in negative direction 
(ie. left or up),
 .B keyhigh
 defines the keys to be generated when the axis is moved in positive direction 
(ie. right or down).
 
-The keys will be autorepeated according to current keyboard settings.
+If 
+.B mode
+is set to 
+.IR relative :
+The driver will emulate autorepeat according to the current value of the axis. 
A keydown and subsequent keyup event will be generated in short time intervals. 
To modify that interval and the autorepeat speed, supply the

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

2007-04-21 Thread Brice Goglin
 ChangeLog  |6 
 configure.ac   |   42 +-
 man/.cvsignore |2 
 man/.gitignore |3 
 man/Makefile.am|4 
 man/joystick.man   |  217 ++
 src/.cvsignore |6 
 src/.gitignore |6 
 src/Makefile.am|   18 +
 src/bsd_jstk.c |  315 +
 src/jstk.c |  608 
 src/jstk.h |  123 
 src/jstk_axis.c|  348 +++
 src/jstk_axis.h|   31 ++
 src/jstk_hw.h  |   38 ++
 src/jstk_options.c |  212 ++
 src/jstk_options.h |   35 ++
 src/linux_jstk.c   |  191 
 src/xf86Jstk.c |  795 -
 19 files changed, 2174 insertions(+), 826 deletions(-)

New commits:
commit 25b5234948b6231577d44c5ad97a85d3a82b514a
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Fri Apr 20 21:09:10 2007 -0400

Fixed wrong button number reported by bsd_jstk.c.
Fixed typo in reporting button and axes numbers in bsd_jstk.c

diff --git a/src/bsd_jstk.c b/src/bsd_jstk.c
index 61ae781..a0c8ea3 100644
--- a/src/bsd_jstk.c
+++ b/src/bsd_jstk.c
@@ -78,7 +78,7 @@ struct jstk_bsd_hid_data {
 int
 jstkOpenDevice(JoystickDevPtr joystick)
 {
-  int cur_axis, cur_button;
+  int cur_axis;
   int is_joystick, report_id = 0;
   int got_something;
   struct hid_data *d;
@@ -124,7 +124,6 @@ jstkOpenDevice(JoystickDevPtr joystick)
   is_joystick = 0;
   got_something = 0;
   cur_axis = 0;
-  cur_button = 0;
   bsddata-hats = 0;
   bsddata-axes = 0;
   bsddata-buttons = 0;
@@ -172,8 +171,7 @@ jstkOpenDevice(JoystickDevPtr joystick)
{
   if (bsddata-buttons  MAXBUTTONS) {
got_something = 1;
-memcpy(bsddata-button_item[cur_button], h, sizeof(h));
-cur_button++;
+memcpy(bsddata-button_item[bsddata-buttons], h, sizeof(h));
 bsddata-buttons++;
   }
}
@@ -192,7 +190,7 @@ jstkOpenDevice(JoystickDevPtr joystick)
   bsddata-hotdata = 0;
   joystick-devicedata = (void*) bsddata;
   xf86Msg(X_INFO, Joystick: %d buttons, %d axes\n, 
-  bsddata-axes, bsddata-buttons);
+  bsddata-buttons, bsddata-axes);
 
   return joystick-fd;
 }
@@ -300,8 +298,9 @@ jstkReadData(JoystickDevPtr joystick,
 
   for (j=0; jbsddata-buttons; j++)
 {
-   int pressed = (d == bsddata-button_item[j].logical_minimum) ? 0 : 1;
+   int pressed;
d = hid_get_data(bsddata-data_buf, bsddata-button_item[j]);
+   pressed = (d == bsddata-button_item[j].logical_minimum) ? 0 : 1;
if (pressed != joystick-button[j].pressed) {
  joystick-button[j].pressed = pressed;
  if (event != NULL) *event = EVENT_BUTTON;

commit e1871e21955d5403c2751e83b5c00b2fa4886f22
Author: Sascha Hlusiak [EMAIL PROTECTED]
Date:   Thu Apr 19 12:39:53 2007 -0400

Fixed accelerated axis movement not working the first time after startup

Modified used algorithm to produce slower and smoother acceleration

diff --git a/src/jstk_axis.c b/src/jstk_axis.c
index d71dc9b..4840ade 100644
--- a/src/jstk_axis.c
+++ b/src/jstk_axis.c
@@ -89,9 +89,9 @@ jstkAxisTimer(OsTimerPtrtimer,
 
 } else if (axis-type == TYPE_ACCELERATED) {
   /* Stop to accelerate at a certain speed */
-  if (axis-currentspeed  100.0f) axis-currentspeed *= 1.15f;
-
-  p1 = (axis-currentspeed - 0.1f) * (float)NEXTTIMER / 180.0f;
+  if (axis-currentspeed  100.0f) axis-currentspeed = 
+ (axis-currentspeed + 3.0) * 1.07f - 3.0;
+  p1 = axis-currentspeed * (float)NEXTTIMER / 180.0f;
   p2 = p1 / 8.0f;
 }
 if (axis-value  0) {
@@ -124,9 +124,10 @@ jstkAxisTimer(OsTimerPtrtimer,
 float p1;
 float p2;
 
-if (priv-button[i].currentspeed  100.0f) priv-button[i].currentspeed *= 
1.15f;
-p1 = (priv-button[i].currentspeed - 0.1) * (float)NEXTTIMER / 180.0f *
- priv-button[i].amplify;
+if (priv-button[i].currentspeed  100.0f) priv-button[i].currentspeed = 
+   (priv-button[i].currentspeed + 3.0) * 1.07f - 3.0;
+   p1 = priv-button[i].currentspeed * (float)NEXTTIMER / 180.0f *
+priv-button[i].amplify;
 p1 *= priv-amplify;
 p2 = p1 / 8.0f;
 
diff --git a/src/jstk_options.c b/src/jstk_options.c
index 191cb24..a45c883 100644
--- a/src/jstk_options.c
+++ b/src/jstk_options.c
@@ -100,6 +100,7 @@ jstkParseButtonOption(const char* org,
   } else if (sscanf(param, axis=%15s, p) == 1) {
 button-mapping = jstkGetAxisMapping(fvalue, p, name);
 button-amplify = fvalue;
+button-currentspeed = 1.0;
 if (button-mapping == MAPPING_NONE)
   xf86Msg(X_WARNING, %s: error parsing axis: %s.\n, 
   name, p);
@@ -160,9 +161,10 @@ jstkParseAxisOption(const char* org, AXIS *axis, const 
char *name)
   p[15]='\0';
   if (strcmp(p, relative) == 0)
 axis-type = TYPE_BYVALUE;
-  else if (strcmp(p, accelerated) == 0)
+

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

2007-01-28 Thread David Nusinow
New branch 'upstream-unstable' available with the following commits:
commit b785d61b96d6f16a96aa4bc60777aea444760b8a
Author: Alan Coopersmith [EMAIL PROTECTED]
Date:   Mon Jan 8 19:07:36 2007 -0800

renamed: .cvsignore - .gitignore

commit f0c85f1ffc9be543c09f3e0ff598407a8028813c
Author: Alan Coopersmith [EMAIL PROTECTED]
Date:   Mon Jan 8 19:07:06 2007 -0800

Fix warning: Undefined function PRIVATE()

commit 57ab5f2de3bd4de1987b436822acdb7e7ef23dc5
Author: Adam Jackson [EMAIL PROTECTED]
Date:   Fri Apr 7 17:40:06 2006 +

Unlibcwrap. Bump server version requirement. Bump to 1.1.0.

commit c6d37e34b58991b68cccb2d098cce963e68ffd09
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Wed Dec 21 02:29:57 2005 +

Update package version for X11R7 release.

commit 8a2817e0868d7e2e9805e6bd57fad084bcc5f6cb
Author: Adam Jackson [EMAIL PROTECTED]
Date:   Mon Dec 19 16:25:50 2005 +

Stub COPYING files

commit 714ce894fc8d456049a1a6f65792873dfde634e8
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Thu Dec 15 00:24:14 2005 +

Update package version number for final X11R7 release candidate.

commit df603768f3b2c41c2fc3d6dff7df0c658508ef53
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Tue Dec 6 22:48:30 2005 +

Change *man_SOURCES == *man_PRE to fix autotools warnings.

commit 49b3bbf7ef024db87e00e60351118bf1b6b24713
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Sat Dec 3 05:49:31 2005 +

Update package version number for X11R7 RC3 release.

commit 6d91b69c1cc17cc07e8b477b4ac43fdbd224a0f7
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Fri Dec 2 02:16:05 2005 +

Remove extraneous AC_MSG_RESULT.

commit 5c3c4b1dedddce558ce718267b46afe67ba39953
Author: Adam Jackson [EMAIL PROTECTED]
Date:   Tue Nov 29 23:29:56 2005 +

Only build dlloader modules by default.

commit 6e2adafe15fdcc0a21da07a1aade0a2dc1b15b81
Author: Alan Coopersmith [EMAIL PROTECTED]
Date:   Mon Nov 28 22:04:07 2005 +

Change *mandir targets to use new *_MAN_DIR variables set by xorg-macros.m4
update to fix bug #5167 (Linux prefers *.1x man pages in man1 subdir)

commit 6556e4ad51488418ce007ea77a3f921df5ff87a4
Author: Eric Anholt [EMAIL PROTECTED]
Date:   Mon Nov 21 10:49:04 2005 +

Add .cvsignores for drivers.

commit 893fe68cca5ca0d354d6b0ae7e44b06c07d5bf61
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Wed Nov 9 21:15:12 2005 +

Update package version number for X11R7 RC2 release.

commit 9bae7c922063cd9fa0e57a1765a309586c36b092
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Tue Nov 1 15:08:50 2005 +

Update pkgcheck depedencies to work with separate build roots.

commit 005b12af9722f32f4cfcbcdda76611b29413899b
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Wed Oct 19 02:48:00 2005 +

Update package version number for RC1 release.

commit 668cb548e8f5e55db2680a94a0ed18da5d102941
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Tue Oct 18 15:46:36 2005 +

Do the following to make the drivers pass distcheck:
- Only define EXTRA_DIST when there are actually man pages to be processed
- Add missing man pages to keyboard and ati drivers EXTRA_DIST

commit aac3f60f1bfce0238698a76acb717f30f8c9303f
Author: Alan Coopersmith [EMAIL PROTECTED]
Date:   Tue Oct 18 00:01:51 2005 +

Use @DRIVER_MAN_SUFFIX@ instead of $(DRIVER_MAN_SUFFIX) in macro
substitutions to work better with BSD make

commit 5e97ce410435e126486eabdd6bf28ca82abf3150
Author: Adam Jackson [EMAIL PROTECTED]
Date:   Mon Oct 17 22:57:28 2005 +

More 1.7 braindamage: define EXTRA_DIST in terms of @DRIVER_NAME@ instead
of indirectly

commit dc59b349eac072ba2d97138fcbba72e5aa0c0299
Author: Alan Coopersmith [EMAIL PROTECTED]
Date:   Mon Oct 17 00:08:57 2005 +

Use sed  cpp to substitute variables in driver man pages

commit 699f0d0028bdcbbb7fa5f5937a5acb48309d50e8
Author: Daniel Stone [EMAIL PROTECTED]
Date:   Thu Aug 18 09:03:39 2005 +

Update autogen.sh to one that does objdir != srcdir.

commit ff835930aee87f0cc3db60d5e03b0adf6b18d05f
Author: Søren Sandmann Pedersen [EMAIL PROTECTED]
Date:   Wed Aug 10 14:07:23 2005 +

Don\'t lose existing CFLAGS in all the input drivers and some of the video
drivers

commit f5f5615ee52b78841c40b4b59aac7f5350929be3
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Fri Jul 29 21:22:41 2005 +

Various changes preparing packages for RC0:
- Verify and update package version numbers as needed
- Implement versioning scheme
- Change bug address to point to bugzilla bug entry form
- Disable loadable i18n in libX11 by default (use --enable-loadable-i18n to
reenable it)
- Fix makedepend to use pkgconfig and pass distcheck
- Update build script to build macros first
- Update modular Xorg version

commit a52f5ddc44da8c1256340020650763ecf7340ce9
Author: Kevin E Martin [EMAIL PROTECTED]
Date:   Wed Jul 13 20:03:22 2005 +

Make the