Revert update to xf86-input-joystick 1.6.0.

This driver depends on xserver 1.10.
This commit is contained in:
matthieu 2011-07-02 21:59:45 +00:00
parent 9d3ad247f2
commit 759486bcc4
28 changed files with 2251 additions and 1447 deletions

View File

@ -1,41 +1,12 @@
Copyright 2007-2008 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the name of Sascha Hlusiak not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. Sascha Hlusiak makes no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
SASCHA HLUSIAK DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL SASCHA HLUSIAK BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
This is a stub file. This package has not yet had its complete licensing
information compiled. Please see the individual source files for details on
your rights to use and modify this software.
Copyright 2007-2009 by Sascha Hlusiak. <saschahlusiak@freedesktop.org>
Copyright 1995-1999 by Frederic Lepied, France. <Lepied@XFree86.org>
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation, and that the names of copyright holders not be used in
advertising or publicity pertaining to distribution of the software without
specific, written prior permission. The copyright holders make no
representations about the suitability of this software for any purpose. It
is provided "as is" without express or implied warranty.
THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
Please submit updated COPYING files to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All licensing questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg

View File

@ -1,429 +1,3 @@
commit bd6c54fe672a913334bfba1ca5dc0f2e0f1f1152
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Wed Apr 20 20:55:24 2011 +0200
joystick 1.6.0
Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
commit f1b8ef560049f1bb1bca9caa12c1529c9f992a09
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Wed Apr 20 20:48:28 2011 +0200
Updated man page to reflect latest changes
commit aa78e01edabb27d1b5dcd4ffe2be32878a45e342
Author: Sascha Hlusiak <saschahlusiak@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.
commit 29d3745e73d266db173828f40231cb78ec1c383a
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Wed Apr 20 19:48:28 2011 +0200
Revert "config: fdi file must be installed in $(datadir)/hal/fdi/policy/20thirdparty"
The fdi file was never meant to be installed by default but exists merely as an
example and documentation for distributors who may decide to ship it by default or
install it in share/doc/...
This reverts commit 1d67a2da26fa3ba0b8f5498da89c01aeaa551515.
commit 4358209e7e4383b4ebdec93cc116bb1c21d373a7
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Wed Apr 20 19:33:10 2011 +0200
Free pInfo->private only once to fix server crash on unplug (bug #35391)
The hotplugged keyboard device and the main device share the same pInfo->private data
and the same jstkCoreUnInit, so the data is freed twice. Furthermore, since the keyboard
device will delete itself, we must not delete it from within the deletion of the main device.
Freeing pInfo->private is done by the main device, hopefully done independently of the order
in which the two devices will be removed by the server.
Should fix bug #35391
commit 3f03fa76f8fb152210c6ed80191f34e428af2c00
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed Apr 6 21:02:49 2011 +1000
joystick 1.5.99.901
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 8c7ad54d6d869bb4202aee8408c72ed72bf929a7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 17:00:28 2010 +1000
Support input ABI 12
This commit adds support for input ABI 12, consisting of a number of
changes:
- requires an X server with an ABI of 12
- valuators have a per-mode setting
- new PreInit prototype.
Because of the new PreInit prototype, the hotplug system has been switched
around too (should have probably been done in a separate commit before,
but...).
The old hotplug mechanism added a separate ModuleInfoRec for the keyboard
part of the driver. This isn't feasable for InputClass configurations, the
driver part may get overwritten.
On entering the driver, after checking a few default values, hotplug the
keyboard device (wacom-style) and let it initialize. Because NIDR calls
DEVICE_INIT and DEVICE_ON the keyboard must initialise the private pointer
and pass it back to the original device.
Call order is:
NewInputDeviceRequest
- jstkCorePreInit
- jstkKeyboardHotplug
- NewInputDeviceRequest
- jstkCorePreInit
immediately return jstkKeyboardPreInit()
- keyboard DEVICE_INIT
- keyboard DEVICE_ON
return keyboard device
- copy keyboard->priv to joystick->priv
- finish jstkCorePreInit as normal
- joystick DEVICE_INIT
- joystick DEVICE_ON
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit f2050e6be5b6b3f8c429060992cc3ead0cfe86c1
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 16:51:15 2010 +1000
Get the option values from pInfo instead of from the IDevRec.
Doesn't matter which one we take, but ABI 12 dropped the IDevRec.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit df0567d2fa2d67a00dce78a89803e8925d20e324
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 16:48:50 2010 +1000
Don't call xf86OptionListReport()
All options used by the driver will show up in the log anyway.
And new xserver versions will call this for debugging purposes for us.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 135aaf612bcb591ae1692ae47b2d36a814230cbe
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:19:08 2010 +1000
Purge use of XI_PRIVATE macro.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 29a486ba56bc6279297a716b018ba24880680e82
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:14:47 2010 +1000
Drop close_proc, conversion_proc, reverse_conversion_proc
All three aren't called by the server.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 0674bdfdb67e9195af7cb5982ae2eda0fa03ce57
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:09:32 2010 +1000
Don't handle history_size in the driver.
This has been handled in the server for quite a while now, just initialize
with the defaults and ignore it otherwise.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 39205d76cb45242ee9b47594ec5be7edc509edc7
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:08:49 2010 +1000
Require server 1.9, drop pre-ABI 11 support.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 074dc4a2a06aebae144afc21de5c4f8bc365937d
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:04:44 2010 +1000
Remove usage of XI86_POINTER_CAPABLE flag.
Flag was write-only for a number of server generations already.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit 107e4b14d90d06864247c7878ee0cc5f59e4bc5a
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 14:47:31 2010 +1000
Replace LocalDevicePtr with InputInfoPtr
Both typedefs describe the same struct, LocalDevicePtr has been removed with
input ABI 12.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Trevor Woerner <twoerner@gmail.com>
commit a23a4a77c7157c516a8194e05e9f07b64d8e8089
Author: Peter Hutterer <peter.hutterer@who-t.net>
Date: Tue Dec 14 15:03:45 2010 +1000
Bump to 1.5.99
commit cd6b81d377a5d541100996fa4e2ac2decffe65f1
Author: Trevor Woerner <twoerner@gmail.com>
Date: Sun Oct 17 21:26:16 2010 -0400
Code cleanup, bad structure initialization.
The InputDriverRec data structure in xserver/hw/xfree86/common/xf86Xinput.h
no longer contains an integer refCount member; as per commit
d568221710959cf7d783e6ff0fb80fb43a231124.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit 38363bde5d94c9a8f163fde31ede067f6d0d1669
Author: Trevor Woerner <twoerner@gmail.com>
Date: Sun Oct 17 21:25:56 2010 -0400
Deprecated code cleanup.
Replace calls to deprecated functions (Xfree(), Xcalloc(), Xmalloc(), etc)
with calls to standard dynamic memory functions (free(), calloc(), malloc(),
etc) in driver code.
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
commit d209590c06e7a4df9d921ff53cb9792e9beb1aeb
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Jun 11 22:00:45 2010 -0400
COPYING: replace stub file with Copyright notices
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 1d67a2da26fa3ba0b8f5498da89c01aeaa551515
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Jun 11 21:50:34 2010 -0400
config: fdi file must be installed in $(datadir)/hal/fdi/policy/20thirdparty
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 09ca64e76568868e8f9c7bf48e8858669fc5aaa7
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Jun 11 21:47:23 2010 -0400
config: EXTRA_DIST is redundant
sdkdir provides the install path for sdk_HEADERS primary
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 55783bf0cd5e0ae29b008dd3fc3a47c66eabffbd
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Jun 11 17:46:37 2010 -0400
config: upgrade to util-macros 1.8 for additional man page support
Use MAN_SUBST now supplied in XORG_MANPAGE_SECTIONS
The value of MAN_SUBST is the same for all X.Org packages.
Use AC_PROG_SED now supplied by XORG_DEFAULT_OPTIONS
Use $(AM_V_GEN)$(SED) to support silent rule
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 342908f4d06c8000789d659b9f8871e56812b78e
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Fri Jun 11 17:41:59 2010 -0400
config: fix warnings, m4 quoting and layout
Fix some m4 quoting
Fix some autoconf warnings
Regroup statements per section
Add comments
Remove unused NDEBUG define
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit e98f0d0349222a4d981086f944398d32a548d953
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sun Apr 18 15:37:29 2010 -0400
config: remove AC_PROG_CC as it overrides AC_PROG_C_C99
XORG_STRICT_OPTION from XORG_DEFAULT_OPTIONS calls
AC_PROG_C_C99. This sets gcc with -std=gnu99.
If AC_PROG_CC macro is called afterwards, it resets CC to gcc.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit c6908579b56b7d8c478ebe8c07e2a68a30c5de44
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sun Apr 18 15:36:32 2010 -0400
config: remove unrequired AC_HEADER_STDC
Autoconf says:
"This macro is obsolescent, as current systems have conforming
header files. New programs need not use this macro".
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit ab6308ed177fc341ba0cca3e4a9048f858d80007
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sun Apr 18 15:35:45 2010 -0400
config: replace deprecated AM_CONFIG_HEADER with AC_CONFIG_HEADERS
Regroup AC statements at the top.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 2252c78fb11b09c688b1b2cc82a542fc2470b8e2
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sun Apr 18 15:26:16 2010 -0400
config: update AC_PREREQ statement to 2.60
Unrelated to the previous patches, the new value simply reflects
the reality that the minimum level for autoconf to configure
all x.org modules is 2.60 dated June 2006.
ftp://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 25722aa12bfbb5675a02d7d8520ae83fdc5735c8
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Sun Apr 18 15:24:59 2010 -0400
config: remove AH_TOP autoheader statement
The generated config.h does not need to include xorg-server.h
for the content it provides.
Add #include <xorg-server.h> in .[hc] files as needed.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 3de065d6822206695c0aee2fd68cd9db8b2f3063
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Feb 11 10:08:07 2010 -0500
config: move CWARNFLAGS from configure.ac to Makefile.am
Compiler warning flags should be explicitly set in the makefile
rather than being merged with other packages compiler flags.
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit 30d1089cffc9afd9fd468a6c30989e77c7884248
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Jan 15 15:08:26 2010 -0800
Update Sun license notices to current X.Org standard form
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
commit efe94ccfb4505f18a44b39ada256df8ba16b3ec5
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Dec 28 15:05:39 2009 -0500
configure.ac: use backticks rather than $() for cmd subs
Use "$PKG_CONFIG" rather than hard coded "pkg-config"
Acked-by: Dan Nicholson <dbn.lists@gmail.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
commit ad0abb97a19e311988deffd385ca69e96bd106a4
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Nov 23 09:25:05 2009 -0500
Makefile.am: add ChangeLog and INSTALL on MAINTAINERCLEANFILES
Now that the INSTALL file is generated.
Allows running make maintainer-clean.
commit 260c441981c1fe1c6e076bde1a6a26328e6b5675
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Oct 28 14:41:41 2009 -0400
INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
Automake 'foreign' option is specified in configure.ac.
Remove from Makefile.am
commit 877f13a6056cc8b17a73a5d4c839cd8b30065f9b
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Wed Oct 28 14:09:09 2009 -0400
INSTALL, NEWS, README or AUTHORS files are missing/incorrect #24206
Add missing INSTALL file. Use standard GNU file on building tarball
README may have been updated
Remove AUTHORS file as it is empty and no content available yet.
Remove NEWS file as it is empty and no content available yet.
commit 9fc986bd5dc3bd1741b1ad4e4da152edfaf928d9
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Mon Oct 26 12:54:20 2009 -0400
Several driver modules do not have a ChangeLog target in Makefile.am #23814
The git generated ChangeLog replaces the hand written one.
Update configure.ac to xorg-macros level 1.3.
Use XORG_DEFAULT_OPTIONS which replaces four XORG_* macros
Update Makefile.am to add ChangeLog target if missing
Remove ChangeLog from EXTRA_DIST or *CLEAN variables
This is a pre-req for the INSTALL_CMD
commit cd4e5ab0c64f477c343ab161ec309c42b9737450
Author: Gaetan Nadon <memsize@videotron.ca>
Date: Thu Oct 22 12:34:16 2009 -0400
.gitignore: use common defaults with custom section # 24239
Using common defaults will reduce errors and maintenance.
Only the very small or inexistent custom section need periodic maintenance
when the structure of the component changes. Do not edit defaults.
commit eaf8d1a1d87af9f67ca3e3d0436bb9d9a7cfc17a
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Sat Oct 31 12:41:15 2009 +0100
Bump to 1.5.0
Signed-off-by: Sascha Hlusiak <saschahlusiak@arcor.de>
commit 657c01c8ebb9e0571d498356e6d3d03917199328
Author: Sascha Hlusiak <saschahlusiak@arcor.de>
Date: Wed Oct 7 09:24:39 2009 +0200

View File

@ -18,19 +18,19 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTOMAKE_OPTIONS = foreign
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg
SUBDIRS = src man config include
MAINTAINERCLEANFILES = ChangeLog INSTALL
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-joystick.pc
.PHONY: ChangeLog INSTALL
EXTRA_DIST = ChangeLog
MAINTAINERCLEANFILES = ChangeLog
INSTALL:
$(INSTALL_CMD)
.PHONY: ChangeLog
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
dist-hook: ChangeLog

View File

@ -43,9 +43,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -59,8 +59,8 @@ host_triplet = @host@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
$(srcdir)/xorg-joystick.pc.in $(top_srcdir)/configure COPYING \
ChangeLog INSTALL config.guess config.sub depcomp install-sh \
ltmain.sh missing
ChangeLog config.guess config.sub depcomp install-sh ltmain.sh \
missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@ -108,7 +108,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -151,7 +150,6 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -241,11 +239,13 @@ sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AUTOMAKE_OPTIONS = foreign
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir=\$${includedir}/xorg
SUBDIRS = src man config include
MAINTAINERCLEANFILES = ChangeLog INSTALL
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-joystick.pc
EXTRA_DIST = ChangeLog
MAINTAINERCLEANFILES = ChangeLog
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -710,15 +710,12 @@ uninstall-info: uninstall-info-recursive
uninstall-pkgconfigDATA
.PHONY: ChangeLog INSTALL
INSTALL:
$(INSTALL_CMD)
.PHONY: ChangeLog
ChangeLog:
$(CHANGELOG_CMD)
dist-hook: ChangeLog INSTALL
dist-hook: ChangeLog
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -7134,6 +7134,18 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005

View File

@ -1,5 +1,7 @@
/* config.h.in. Generated from configure.ac by autoheader. */
#include "xorg-server.h"
/* Compile BSD usbhid backend */
#undef BSD_BACKEND
@ -63,6 +65,9 @@
/* Compile Linux joystick backend */
#undef LINUX_BACKEND
/* Disable some debugging code */
#undef NDEBUG
/* Name of package */
#undef PACKAGE

View File

@ -1 +1 @@
EXTRA_DIST = 50-x11-input-joystick.fdi 50-joystick-all.conf
EXTRA_DIST = 50-x11-input-joystick.fdi

View File

@ -22,9 +22,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -53,7 +53,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -96,7 +95,6 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -186,7 +184,7 @@ sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = 50-x11-input-joystick.fdi 50-joystick-all.conf
EXTRA_DIST = 50-x11-input-joystick.fdi
all: all-am
.SUFFIXES:
@ -199,9 +197,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign config/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu config/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign config/Makefile
$(AUTOMAKE) --gnu config/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

File diff suppressed because it is too large Load Diff

View File

@ -20,73 +20,70 @@
#
# Process this file with autoconf to produce a configure script
# Initialize Autoconf
AC_PREREQ([2.60])
AC_PREREQ(2.57)
AC_INIT([xf86-input-joystick],
[1.6.0],
1.5.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-joystick])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
xf86-input-joystick)
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_AUX_DIR(.)
AM_INIT_AUTOMAKE([dist-bzip2])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
# Initialize 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)
AM_CONFIG_HEADER([config.h])
# Checks for programs.
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_CC
XORG_CWARNFLAGS
# Initialize X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
AH_TOP([#include "xorg-server.h"])
AC_ARG_WITH(xorg-module-dir,
AC_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory
[[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)
# Checks for extensions
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
XORG_DRIVER_CHECK_EXT(XKB, kbproto)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.9.99.2] xproto $REQUIRED_MODULES)
DRIVER_NAME=joystick
AC_SUBST([DRIVER_NAME])
# -----------------------------------------------------------------------------
# Configuration options
# -----------------------------------------------------------------------------
# Define a configure option for an alternate input module directory
AC_ARG_WITH(xorg-module-dir,
AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
inputdir=${moduledir}/input
AC_SUBST(inputdir)
# Define a configure option for an alternate X Server SDK Headers
# X Server SDK location is required to install joystick header files
PKG_CHECK_MODULES(XORG,
[xorg-server >= 1.3.99.901] xproto $REQUIRED_MODULES)
XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS"
xorg_sdkdir=$(pkg-config --variable=sdkdir xorg-server)
AC_ARG_WITH(sdkdir,
AS_HELP_STRING([--with-sdkdir=<path>],
[Xorg X Server sdk headers (default is autodetected)]),
[sdkdir="$withval"],
[sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`])
AC_HELP_STRING([--with-sdkdir=<path>],
[Xorg X Server sdk headers (default is autodetected)]),
[sdkdir="$withval"], [sdkdir="${xorg_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])
if test "x$DEBUGGING" = xyes; then
AC_DEFINE(DEBUG, 1, [Enable debugging code])
fi
AM_CONDITIONAL(DEBUG, [test "x$DEBUGGING" = xyes])
# Checks for libraries.
# -----------------------------------------------------------------------------
# Determine which joystick backend to build
# -----------------------------------------------------------------------------
# Checks for header files.
linux_backend=yes
AC_CHECK_HEADERS([linux/joystick.h],, [linux_backend=no])
AM_CONDITIONAL(LINUX_BACKEND, [test "x$linux_backend" = xyes])
@ -114,22 +111,27 @@ AM_CONDITIONAL(EVDEV_BACKEND, [test "x$evdev_backend" = xyes])
if test "x$evdev_backend" = xyes; then
AC_DEFINE(EVDEV_BACKEND, 1, [Compile Linux evdev backend])
fi
# -----------------------------------------------------------------------------
AC_CONFIG_FILES([Makefile
src/Makefile
man/Makefile
config/Makefile
include/Makefile
xorg-joystick.pc])
AC_OUTPUT
AC_HEADER_STDC
# -----------------------------------------------------------------------------
DRIVER_NAME=joystick
AC_SUBST([DRIVER_NAME])
AS_ECHO()
AS_ECHO("Building Linux joystick backend: $linux_backend")
AS_ECHO("Building Linux evdev backend: $evdev_backend")
AS_ECHO("Building BSD usbhid backend: $bsd_backend")
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
XORG_CHANGELOG
AC_OUTPUT([Makefile
src/Makefile
man/Makefile
config/Makefile
include/Makefile
xorg-joystick.pc])
echo
echo Building Linux joystick backend: $linux_backend
echo Building Linux evdev backend: $evdev_backend
echo Building BSD usbhid backend: $bsd_backend
if test "x$linux_backend" != "xyes" -a \
"x$bsd_backend" != "xyes" -a \

View File

@ -18,4 +18,6 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
EXTRA_DIST = joystick-properties.h
sdk_HEADERS = joystick-properties.h

View File

@ -43,9 +43,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -86,7 +86,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -129,7 +128,6 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -219,6 +217,7 @@ sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
EXTRA_DIST = joystick-properties.h
sdk_HEADERS = joystick-properties.h
all: all-am
@ -232,9 +231,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign include/Makefile
$(AUTOMAKE) --gnu include/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

View File

@ -1,24 +1,27 @@
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the copyright holders shall
# not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization
# from the copyright holders.
#
drivermandir = $(DRIVER_MAN_DIR)
@ -31,8 +34,25 @@ EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
SED = sed
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
sed $(MAN_SUBSTS) < $< > $@

View File

@ -16,25 +16,28 @@
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the copyright holders shall
# not be used in advertising or otherwise to promote the sale, use or
# other dealings in this Software without prior written authorization
# from the copyright holders.
#
srcdir = @srcdir@
@ -46,9 +49,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -86,7 +89,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -129,7 +131,6 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -148,7 +149,18 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@
MAN_SUBSTS = \
-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-e 's|__xservername__|Xorg|g' \
-e 's|__xconfigfile__|xorg.conf|g' \
-e 's|__projectroot__|$(prefix)|g' \
-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
NMEDIT = @NMEDIT@
@ -162,7 +174,7 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
SED = @SED@
SED = sed
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
@ -224,6 +236,10 @@ driverman_PRE = @DRIVER_NAME@.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = @DRIVER_NAME@.man
CLEANFILES = $(driverman_DATA)
# Strings to replace in man pages
XORGRELSTRING = @PACKAGE_STRING@
XORGMANNAME = X Version 11
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
all: all-am
@ -238,9 +254,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign man/Makefile
$(AUTOMAKE) --gnu man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@ -409,9 +425,8 @@ uninstall-am: uninstall-drivermanDATA uninstall-info-am
uninstall-info-am
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
sed $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -4,19 +4,14 @@
.SH NAME
joystick \- Joystick input driver
.SH SYNOPSIS
Snipped for xorg.conf.d(5):
.nf
.B "Section \*qInputClass\*q"
.BI " Identifier \*q" joystick-all \*q
.BI " Driver \*q" joystick \*q
.BI " Option \*qMatchIsJoystick\*q \*q" on \*q
.BI " Option \*qMatchDevicePath \*q" /dev/input/event* \*q
.B "Section \*qInputDevice\*q"
.BI " Identifier \*q" devname \*q
.B " Driver \*qjoystick\*q"
.BI " Option \*qDevice\*q \*q" devpath \*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:
@ -319,21 +314,33 @@ 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"
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
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
.I ${sourcecode}/config/50-x11-input-joystick.fdi
to be placed in
.IR /etc/hal/fdi/policy .
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
.SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorg.conf.d(5), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), xmodmap(1)
.SH AUTHORS
Sascha Hlusiak (2007-2011),
Sascha Hlusiak (2007-2009),
.fi
Frederic Lepied (1995-1999)

View File

@ -24,8 +24,7 @@
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
AM_CFLAGS = $(XORG_CFLAGS)
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version

View File

@ -34,12 +34,6 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# this is obnoxious:
# -module lets us name the module exactly how we want
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
@ -49,9 +43,9 @@ pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = ${SHELL} $(install_sh) -c -m 644
install_sh_PROGRAM = ${SHELL} $(install_sh) -c
install_sh_SCRIPT = ${SHELL} $(install_sh) -c
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
@ -122,7 +116,6 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@ -165,7 +158,6 @@ FFLAGS = @FFLAGS@
FILE_MAN_DIR = @FILE_MAN_DIR@
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
GREP = @GREP@
INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@ -255,7 +247,13 @@ sdkdir = @sdkdir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
# this is obnoxious:
# -module lets us name the module exactly how we want
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
AM_CFLAGS = $(XORG_CFLAGS)
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version $(am__append_2)
@DRIVER_NAME@_drv_ladir = @inputdir@
@ -281,9 +279,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile
$(AUTOMAKE) --gnu src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \

View File

@ -30,7 +30,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>

View File

@ -29,7 +29,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>

View File

@ -32,7 +32,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>

View File

@ -26,7 +26,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <stdio.h>
#include <xorgVersion.h>
@ -45,7 +44,9 @@
#include "jstk_key.h"
#include "jstk_options.h"
#include "jstk_properties.h"
#include <xserver-properties.h>
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
#include <xserver-properties.h>
#endif
#ifdef LINUX_BACKEND
#include "backend_joystick.h"
@ -62,6 +63,40 @@
char debug_level = 0;
#endif
/*
***************************************************************************
*
* jstkConvertProc --
*
* Convert valuators to X and Y.
*
***************************************************************************
*/
static Bool
jstkConvertProc(LocalDevicePtr local,
int first,
int num,
int v0,
int v1,
int v2,
int v3,
int v4,
int v5,
int* x,
int* y)
{
if (first != 0 || num != 2)
return FALSE;
*x = v0;
*y = v1;
return TRUE;
}
/*
***************************************************************************
*
@ -112,21 +147,21 @@ jstkOpenDevice(JoystickDevPtr priv, BOOL probe)
*/
static void
jstkReadProc(InputInfoPtr pInfo)
jstkReadProc(LocalDevicePtr local)
{
JOYSTICKEVENT event;
int number;
int i, r;
JoystickDevPtr priv = pInfo->private;
JoystickDevPtr priv = local->private;
do {
if ((priv->read_proc == NULL) ||
((r=priv->read_proc(priv, &event, &number))==0)) {
xf86Msg(X_WARNING, "JOYSTICK: Read failed. Deactivating device.\n");
if (pInfo->fd >= 0)
RemoveEnabledDevice(pInfo->fd);
if (local->fd >= 0)
RemoveEnabledDevice(local->fd);
return;
}
@ -139,7 +174,7 @@ jstkReadProc(InputInfoPtr pInfo)
switch (priv->button[number].mapping) {
case JSTK_MAPPING_BUTTON:
if (priv->mouse_enabled == TRUE) {
xf86PostButtonEvent(pInfo->dev, 0,
xf86PostButtonEvent(local->dev, 0,
priv->button[number].buttonnumber,
priv->button[number].pressed, 0, 0);
}
@ -152,7 +187,7 @@ jstkReadProc(InputInfoPtr pInfo)
if (priv->button[number].pressed == 0)
priv->button[number].currentspeed = 1.0;
else if (priv->mouse_enabled == TRUE)
jstkStartButtonAxisTimer(pInfo, number);
jstkStartButtonAxisTimer(local, number);
break;
case JSTK_MAPPING_KEY:
@ -223,7 +258,7 @@ jstkReadProc(InputInfoPtr pInfo)
priv->axis[number].mapping));
if (priv->axis[number].valuator != -1)
xf86PostMotionEvent(pInfo->dev, 1, priv->axis[number].valuator,
xf86PostMotionEvent(local->dev, 1, priv->axis[number].valuator,
1, priv->axis[number].value);
switch (priv->axis[number].mapping) {
@ -237,12 +272,12 @@ jstkReadProc(InputInfoPtr pInfo)
if (priv->axis[number].value == 0)
priv->axis[number].currentspeed = 1.0;
if (priv->mouse_enabled == TRUE)
jstkStartAxisTimer(pInfo, number);
jstkStartAxisTimer(local, number);
break;
case JSTK_TYPE_ABSOLUTE:
if (priv->mouse_enabled == TRUE)
jstkHandleAbsoluteAxis(pInfo, number);
jstkHandleAbsoluteAxis(local, number);
break;
default:
break;
@ -251,9 +286,9 @@ jstkReadProc(InputInfoPtr pInfo)
case JSTK_MAPPING_KEY: if (priv->keys_enabled == TRUE) {
if (priv->axis[number].type == JSTK_TYPE_ACCELERATED) {
jstkHandlePWMAxis(pInfo, number);
jstkHandlePWMAxis(local, number);
} else if (priv->axis[number].type == JSTK_TYPE_BYVALUE) {
jstkStartAxisTimer(pInfo, number);
jstkStartAxisTimer(local, number);
}
break;
}
@ -292,10 +327,12 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
int what)
{
int i;
InputInfoPtr pInfo = (InputInfoPtr)pJstk->public.devicePrivate;
JoystickDevPtr priv = pInfo->private;
LocalDevicePtr local = (LocalDevicePtr)pJstk->public.devicePrivate;
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(pJstk);
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
Atom btn_labels[BUTTONMAP_SIZE+1] = {0}; /* TODO: fillme */
Atom axes_labels[MAXAXES] = {0}; /* TODO: fillme */
#endif
switch (what) {
case DEVICE_INIT: {
@ -318,7 +355,9 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
if (InitButtonClassDeviceStruct(pJstk, BUTTONMAP_SIZE,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
btn_labels,
#endif
buttonmap) == FALSE) {
ErrorF("unable to allocate Button class device\n");
return !Success;
@ -334,48 +373,71 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
priv->axis[i].valuator = m++;
}
if (InitValuatorClassDeviceStruct(pJstk, m, axes_labels,
GetMotionHistorySize(),
if (InitValuatorClassDeviceStruct(pJstk,
m,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels,
#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
xf86GetMotionEvents,
#endif
local->history_size,
Relative) == FALSE) {
ErrorF("unable to allocate Valuator class device\n");
return !Success;
} else {
InitValuatorAxisStruct(pJstk,
0, /* valuator num */
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
XIGetKnownProperty(AXIS_LABEL_PROP_REL_X),
#endif
0, /* min val */
screenInfo.screens[0]->width, /* max val */
1, /* resolution */
0, /* min_res */
1, /* max_res */
Absolute);
1); /* max_res */
InitValuatorAxisStruct(pJstk,
1, /* valuator num */
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y),
#endif
0, /* min val */
screenInfo.screens[0]->height, /* max val */
1, /* resolution */
0, /* min_res */
1, /* max_res */
Absolute);
1); /* max_res */
for (i=0; i<MAXAXES; i++)
if (priv->axis[i].valuator != -1)
{
InitValuatorAxisStruct(pJstk,
priv->axis[i].valuator,
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 7
axes_labels[i],
#endif
-32768, /* min val */
32767, /* max val */
1, /* resolution */
0, /* min_res */
1, /* max_res */
Absolute);
1); /* max_res */
}
/* allocate the motion history buffer if needed */
xf86MotionHistoryAllocate(pInfo);
xf86MotionHistoryAllocate(local);
}
if (priv->keyboard_device != NULL)
{
DBG(2, ErrorF("Activating keyboard device\n"));
xf86ActivateDevice(priv->keyboard_device);
priv->keyboard_device->dev->inited =
(priv->keyboard_device->device_control(priv->keyboard_device->dev, DEVICE_INIT) == Success);
xf86EnableDevice(priv->keyboard_device->dev);
DBG(2, ErrorF("Keyboard device activated\n"));
}
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
jstkInitProperties(pJstk, priv);
#endif
break;
}
@ -386,8 +448,8 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
if (jstkOpenDevice(priv, FALSE) != -1) {
pJstk->public.on = TRUE;
pInfo->fd = priv->fd;
AddEnabledDevice(pInfo->fd);
local->fd = priv->fd;
AddEnabledDevice(local->fd);
} else return !Success;
break;
@ -409,9 +471,9 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
TimerCancel(priv->axis[i].timer);
}
if (pInfo->fd >= 0)
RemoveEnabledDevice(pInfo->fd);
pInfo->fd = -1;
if (local->fd >= 0)
RemoveEnabledDevice(local->fd);
local->fd = -1;
if (priv->close_proc)
priv->close_proc(priv);
pJstk->public.on = FALSE;
@ -425,6 +487,19 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
return Success;
}
_X_EXPORT InputDriverRec JSTK_KEYBOARD = {
1,
"joystick_keyboard",
NULL,
jstkKeyboardPreInit,
jstkKeyboardUnInit,
NULL,
0
};
/*
***************************************************************************
*
@ -432,41 +507,41 @@ jstkDeviceControlProc(DeviceIntPtr pJstk,
*
* Called when a device will be instantiated
*
* This is a tad complicated. NewInputDeviceRequest(), which we use to
* hotplug a keyboard device,. enables the device, so we need to make sure
* that all options for the dependent device are set correctly.
*
* This means that we parse the keyboard-specific options into the
* keyboard device's PreInit, and re-use the keyboard's priv field.
*
***************************************************************************
*/
static int
jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
static InputInfoPtr
jstkCorePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
{
InputInfoPtr keyboard_device;
LocalDevicePtr local = NULL;
JoystickDevPtr priv = NULL;
char *s;
int i, j;
s = xf86CheckStrOption(pInfo->options, "_source", "");
if (strcmp(s, "_driver/joystick") == 0)
return jstkKeyboardPreInit(drv, pInfo, flags);
local = xf86AllocateInput(drv, 0);
if (!local) {
goto SetupProc_fail;
}
pInfo->device_control = jstkDeviceControlProc;
pInfo->read_input = jstkReadProc;
pInfo->control_proc = NULL;
pInfo->switch_mode = NULL;
pInfo->fd = -1;
pInfo->dev = NULL;
pInfo->type_name = XI_JOYSTICK;
local->private = (JoystickDevPtr)xalloc(sizeof(JoystickDevRec));
priv = (JoystickDevPtr)local->private;
keyboard_device = jstkKeyboardHotplug(pInfo, flags);
if (!keyboard_device)
return BadAlloc;
pInfo->private = priv = keyboard_device->private;
local->name = dev->identifier;
local->flags = XI86_POINTER_CAPABLE;
local->flags |= XI86_SEND_DRAG_EVENTS;
local->device_control = jstkDeviceControlProc;
local->read_input = jstkReadProc;
local->close_proc = NULL;
local->control_proc = NULL;
local->switch_mode = NULL;
local->conversion_proc = jstkConvertProc;
local->fd = -1;
local->dev = NULL;
local->private = priv;
local->type_name = XI_JOYSTICK;
local->history_size = 0;
local->always_core_feedback = NULL;
local->conf_idev = dev;
priv->fd = -1;
priv->open_proc = NULL;
@ -479,7 +554,9 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
priv->mouse_enabled = TRUE;
priv->keys_enabled = TRUE;
priv->amplify = 1.0f;
priv->keyboard_device = keyboard_device;
priv->keyboard_device = NULL;
priv->repeat_delay = 0;
priv->repeat_interval = 0;
priv->num_axes = MAXAXES;
priv->num_buttons = MAXBUTTONS;
@ -537,39 +614,81 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
priv->axis[5].type = JSTK_TYPE_ACCELERATED;
priv->axis[5].mapping = JSTK_MAPPING_Y;
xf86CollectInputOptions(local, NULL, NULL);
xf86OptionListReport(local->options);
/* Joystick device is mandatory */
priv->device = xf86SetStrOption(pInfo->options, "Device", NULL);
priv->device = xf86SetStrOption(dev->commonOptions, "Device", NULL);
if (!priv->device)
priv->device = xf86SetStrOption(pInfo->options, "Path", NULL);
priv->device = xf86SetStrOption(dev->commonOptions, "Path", NULL);
if (!priv->device) {
xf86Msg (X_ERROR, "%s: No Device specified.\n", pInfo->name);
xf86Msg (X_ERROR, "%s: No Device specified.\n", local->name);
goto SetupProc_fail;
}
xf86ProcessCommonOptions(local, local->options);
#if DEBUG
debug_level = xf86SetIntOption(pInfo->options, "DebugLevel", 0);
debug_level = xf86SetIntOption(dev->commonOptions, "DebugLevel", 0);
if (debug_level > 0) {
xf86Msg(X_CONFIG, "%s: debug level set to %d\n",
pInfo->name, debug_level);
local->name, debug_level);
}
#else
if (xf86SetIntOption(pInfo->options, "DebugLevel", 0) != 0) {
if (xf86SetIntOption(dev->commonOptions, "DebugLevel", 0) != 0) {
xf86Msg(X_WARNING, "%s: DebugLevel: Compiled without debugging support!\n",
pInfo->name);
local->name);
}
#endif
priv->mouse_enabled = xf86SetBoolOption(pInfo->options, "StartMouseEnabled", TRUE);
priv->keys_enabled = xf86SetBoolOption(pInfo->options, "StartKeysEnabled", TRUE);
/* 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;
DBG(1, xf86Msg(X_CONFIG, "Autorepeat set to delay=%d, interval=%d\n",
priv->repeat_delay,priv->repeat_interval));
}
xfree(s);
}
priv->rmlvo.rules = xf86SetStrOption(dev->commonOptions, "xkb_rules", NULL);
if (!priv->rmlvo.rules)
priv->rmlvo.rules = xf86SetStrOption(dev->commonOptions, "XkbRules", "evdev");
priv->rmlvo.model = xf86SetStrOption(dev->commonOptions, "xkb_model", NULL);
if (!priv->rmlvo.model)
priv->rmlvo.model = xf86SetStrOption(dev->commonOptions, "XkbModel", "evdev");
priv->rmlvo.layout = xf86SetStrOption(dev->commonOptions, "xkb_layout", NULL);
if (!priv->rmlvo.layout)
priv->rmlvo.layout = xf86SetStrOption(dev->commonOptions, "XkbLayout", "us");
priv->rmlvo.variant = xf86SetStrOption(dev->commonOptions, "xkb_variant", NULL);
if (!priv->rmlvo.variant)
priv->rmlvo.variant = xf86SetStrOption(dev->commonOptions, "XkbVariant", "");
priv->rmlvo.options = xf86SetStrOption(dev->commonOptions, "xkb_options", NULL);
if (!priv->rmlvo.options)
priv->rmlvo.options = xf86SetStrOption(dev->commonOptions, "XkbOptions", "");
priv->mouse_enabled = xf86SetBoolOption(dev->commonOptions, "StartMouseEnabled", TRUE);
priv->keys_enabled = xf86SetBoolOption(dev->commonOptions, "StartKeysEnabled", TRUE);
/* Process button mapping options */
for (i=0; i<MAXBUTTONS; i++) {
char p[64];
sprintf(p,"MapButton%d",i+1);
s = xf86SetStrOption(pInfo->options, p, NULL);
s = xf86SetStrOption(dev->commonOptions, p, NULL);
if (s != NULL) {
jstkParseButtonOption(s, priv, i, pInfo->name);
jstkParseButtonOption(s, priv, i, local->name);
}
DBG(1, xf86Msg(X_CONFIG, "Button %d mapped to %d\n", i+1,
priv->button[i].mapping));
@ -579,9 +698,9 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
for (i=0; i<MAXAXES; i++) {
char p[64];
sprintf(p,"MapAxis%d",i+1);
s = xf86SetStrOption(pInfo->options, p, NULL);
s = xf86SetStrOption(dev->commonOptions, p, NULL);
if (s != NULL) {
jstkParseAxisOption(s, priv, &priv->axis[i], pInfo->name);
jstkParseAxisOption(s, priv, &priv->axis[i], local->name);
}
DBG(1, xf86Msg(X_CONFIG,
"Axis %d type is %d, mapped to %d, amplify=%.3f\n", i+1,
@ -590,17 +709,23 @@ jstkCorePreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
priv->axis[i].amplify));
}
return Success;
/* return the LocalDevice */
local->flags |= XI86_CONFIGURED;
priv->keyboard_device = jstkKeyboardPreInit(&JSTK_KEYBOARD, dev, flags);
if (priv->keyboard_device) {
priv->keyboard_device->private = priv;
}
return (local);
SetupProc_fail:
if (priv) {
free(priv);
if (keyboard_device)
keyboard_device->private = NULL;
}
if (pInfo)
pInfo->private = NULL;
return BadValue;
if (priv)
xfree(priv);
if (local)
local->private = NULL;
return NULL;
/* return (local); */ /* Makes X segfault on error */
}
@ -611,39 +736,26 @@ SetupProc_fail:
* jstkCoreUnInit --
*
* Called when a device is unplugged and needs to be removed
* This is a bit tricky, because the keyboard device and the main device
* share the same private data, which must be freed only once, which is done
* by the main device.
*
*
***************************************************************************
*/
static void
jstkCoreUnInit(InputDriverPtr drv,
InputInfoPtr pInfo,
LocalDevicePtr local,
int flags)
{
if (pInfo->private) {
JoystickDevPtr priv = (JoystickDevPtr) pInfo->private;
if (priv->keyboard_device == pInfo) {
/* this is the keyboard device */
/* Unlink from private data to notify that the
* keyboard device is no more, but don't free */
priv->keyboard_device = NULL;
} else {
/* freeing main device
if keyboard still exists, notify keyboard device that it's
private data is gone */
if (priv->keyboard_device)
priv->keyboard_device->private = NULL;
free (priv);
}
JoystickDevPtr device = (JoystickDevPtr) local->private;
if (device->keyboard_device != NULL)
{
xf86DisableDevice(device->keyboard_device->dev, TRUE);
device->keyboard_device = NULL;
}
pInfo->private = NULL;
xf86DeleteInput(pInfo, 0);
xfree (device);
local->private = NULL;
xf86DeleteInput(local, 0);
}
@ -655,9 +767,11 @@ _X_EXPORT InputDriverRec JOYSTICK = {
NULL,
jstkCorePreInit,
jstkCoreUnInit,
NULL
NULL,
0
};
/*
***************************************************************************
*
@ -675,6 +789,7 @@ jstkDriverPlug(pointer module,
int *errmin)
{
xf86AddInputDriver(&JOYSTICK, module, 0);
xf86AddInputDriver(&JSTK_KEYBOARD, module, 0);
return module;
}

View File

@ -55,6 +55,17 @@
#define XI_JOYSTICK "JOYSTICK"
#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
typedef struct {
char *rules;
char *model;
char *layout;
char *variant;
char *options;
} XkbRMLVOSet;
#endif
typedef enum _JOYSTICKEVENT {
EVENT_NONE=0,
@ -106,7 +117,7 @@ typedef struct _JoystickDevRec {
jstkReadDataProc read_proc; /* Callback for reading data from the backend */
void *devicedata; /* Extra platform device dependend data */
char *device; /* Name of the device */
InputInfoPtr keyboard_device; /* Slave device for keyboard events */
LocalDevicePtr keyboard_device; /* Slave device for keyboard events */
OsTimerPtr timer; /* Timer for axis movement */
Bool timerrunning;

View File

@ -27,7 +27,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <xf86Xinput.h>
#include <xf86_OSproc.h>
#include <math.h>
@ -56,8 +55,7 @@ jstkAxisTimer(OsTimerPtr timer,
{
#define NEXTTIMER 15
DeviceIntPtr device = (DeviceIntPtr)arg;
InputInfoPtr pInfo = device->public.devicePrivate;
JoystickDevPtr priv = pInfo->private;
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(device);
int sigstate, i;
int nexttimer;
@ -268,7 +266,7 @@ jstkAxisTimer(OsTimerPtr timer,
***********************************************************************
*/
void
jstkStartAxisTimer(InputInfoPtr device, int number)
jstkStartAxisTimer(LocalDevicePtr device, int number)
{
int pixel;
JoystickDevPtr priv = device->private;
@ -300,7 +298,7 @@ jstkStartAxisTimer(InputInfoPtr device, int number)
*/
void
jstkStartButtonAxisTimer(InputInfoPtr device, int number)
jstkStartButtonAxisTimer(LocalDevicePtr device, int number)
{
int pixel;
JoystickDevPtr priv = device->private;
@ -340,7 +338,7 @@ jstkStartButtonAxisTimer(InputInfoPtr device, int number)
***********************************************************************
*/
void
jstkHandleAbsoluteAxis(InputInfoPtr device, int number)
jstkHandleAbsoluteAxis(LocalDevicePtr device, int number)
{
JoystickDevPtr priv = device->private;
int i,x,y;
@ -408,8 +406,7 @@ jstkPWMAxisTimer(OsTimerPtr timer,
pointer arg)
{
DeviceIntPtr device = (DeviceIntPtr)arg;
InputInfoPtr pInfo = device->public.devicePrivate;
JoystickDevPtr priv = pInfo->private;
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(device);
int sigstate, i;
int nexttimer;
@ -538,7 +535,7 @@ jstkPWMAxisTimer(OsTimerPtr timer,
***********************************************************************
*/
void
jstkHandlePWMAxis(InputInfoPtr device, int number)
jstkHandlePWMAxis(LocalDevicePtr device, int number)
{
JoystickDevPtr priv = device->private;
if (priv->axis[number].timerrunning) return;

View File

@ -24,9 +24,9 @@
#ifndef _XF86JSTK_AXIS_H_INCLUDED_
#define _XF86JSTK_AXIS_H_INCLUDED_
void jstkStartAxisTimer(InputInfoPtr device, int number);
void jstkStartButtonAxisTimer(InputInfoPtr device, int number);
void jstkHandleAbsoluteAxis(InputInfoPtr device, int number);
void jstkHandlePWMAxis(InputInfoPtr device, int number);
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

View File

@ -28,7 +28,6 @@
#endif
#include <xorg-server.h>
#include <xf86.h>
#include <xf86Xinput.h>
#include <X11/extensions/XKBsrv.h>
@ -39,7 +38,9 @@
#include "jstk.h"
#include "jstk_key.h"
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
#include <xkbsrv.h>
#endif
#define MIN_KEYCODE 8
#define GLYPHS_PER_KEY 2
@ -50,6 +51,280 @@
#define KanaMask Mod4Mask
#define ScrollLockMask Mod5Mask
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
static KeySym map[] = {
/* 0x00 */ NoSymbol, NoSymbol,
/* 0x01 */ XK_Escape, NoSymbol,
/* 0x02 */ XK_1, XK_exclam,
/* 0x03 */ XK_2, XK_at,
/* 0x04 */ XK_3, XK_numbersign,
/* 0x05 */ XK_4, XK_dollar,
/* 0x06 */ XK_5, XK_percent,
/* 0x07 */ XK_6, XK_asciicircum,
/* 0x08 */ XK_7, XK_ampersand,
/* 0x09 */ XK_8, XK_asterisk,
/* 0x0a */ XK_9, XK_parenleft,
/* 0x0b */ XK_0, XK_parenright,
/* 0x0c */ XK_minus, XK_underscore,
/* 0x0d */ XK_equal, XK_plus,
/* 0x0e */ XK_BackSpace, NoSymbol,
/* 0x0f */ XK_Tab, XK_ISO_Left_Tab,
/* 0x10 */ XK_Q, NoSymbol,
/* 0x11 */ XK_W, NoSymbol,
/* 0x12 */ XK_E, NoSymbol,
/* 0x13 */ XK_R, NoSymbol,
/* 0x14 */ XK_T, NoSymbol,
/* 0x15 */ XK_Y, NoSymbol,
/* 0x16 */ XK_U, NoSymbol,
/* 0x17 */ XK_I, NoSymbol,
/* 0x18 */ XK_O, NoSymbol,
/* 0x19 */ XK_P, NoSymbol,
/* 0x1a */ XK_bracketleft, XK_braceleft,
/* 0x1b */ XK_bracketright,XK_braceright,
/* 0x1c */ XK_Return, NoSymbol,
/* 0x1d */ XK_Control_L, NoSymbol,
/* 0x1e */ XK_A, NoSymbol,
/* 0x1f */ XK_S, NoSymbol,
/* 0x20 */ XK_D, NoSymbol,
/* 0x21 */ XK_F, NoSymbol,
/* 0x22 */ XK_G, NoSymbol,
/* 0x23 */ XK_H, NoSymbol,
/* 0x24 */ XK_J, NoSymbol,
/* 0x25 */ XK_K, NoSymbol,
/* 0x26 */ XK_L, NoSymbol,
/* 0x27 */ XK_semicolon, XK_colon,
/* 0x28 */ XK_quoteright, XK_quotedbl,
/* 0x29 */ XK_quoteleft, XK_asciitilde,
/* 0x2a */ XK_Shift_L, NoSymbol,
/* 0x2b */ XK_backslash, XK_bar,
/* 0x2c */ XK_Z, NoSymbol,
/* 0x2d */ XK_X, NoSymbol,
/* 0x2e */ XK_C, NoSymbol,
/* 0x2f */ XK_V, NoSymbol,
/* 0x30 */ XK_B, NoSymbol,
/* 0x31 */ XK_N, NoSymbol,
/* 0x32 */ XK_M, NoSymbol,
/* 0x33 */ XK_comma, XK_less,
/* 0x34 */ XK_period, XK_greater,
/* 0x35 */ XK_slash, XK_question,
/* 0x36 */ XK_Shift_R, NoSymbol,
/* 0x37 */ XK_KP_Multiply, NoSymbol,
/* 0x38 */ XK_Alt_L, XK_Meta_L,
/* 0x39 */ XK_space, NoSymbol,
/* 0x3a */ XK_Caps_Lock, NoSymbol,
/* 0x3b */ XK_F1, NoSymbol,
/* 0x3c */ XK_F2, NoSymbol,
/* 0x3d */ XK_F3, NoSymbol,
/* 0x3e */ XK_F4, NoSymbol,
/* 0x3f */ XK_F5, NoSymbol,
/* 0x40 */ XK_F6, NoSymbol,
/* 0x41 */ XK_F7, NoSymbol,
/* 0x42 */ XK_F8, NoSymbol,
/* 0x43 */ XK_F9, NoSymbol,
/* 0x44 */ XK_F10, NoSymbol,
/* 0x45 */ XK_Num_Lock, NoSymbol,
/* 0x46 */ XK_Scroll_Lock, NoSymbol,
/* These KP keys should have the KP_7 keysyms in the numlock
* modifer... ? */
/* 0x47 */ XK_KP_Home, XK_KP_7,
/* 0x48 */ XK_KP_Up, XK_KP_8,
/* 0x49 */ XK_KP_Prior, XK_KP_9,
/* 0x4a */ XK_KP_Subtract, NoSymbol,
/* 0x4b */ XK_KP_Left, XK_KP_4,
/* 0x4c */ XK_KP_Begin, XK_KP_5,
/* 0x4d */ XK_KP_Right, XK_KP_6,
/* 0x4e */ XK_KP_Add, NoSymbol,
/* 0x4f */ XK_KP_End, XK_KP_1,
/* 0x50 */ XK_KP_Down, XK_KP_2,
/* 0x51 */ XK_KP_Next, XK_KP_3,
/* 0x52 */ XK_KP_Insert, XK_KP_0,
/* 0x53 */ XK_KP_Delete, XK_KP_Decimal,
/* 0x54 */ NoSymbol, NoSymbol,
/* 0x55 */ XK_F13, NoSymbol,
/* 0x56 */ XK_less, XK_greater,
/* 0x57 */ XK_F11, NoSymbol,
/* 0x58 */ XK_F12, NoSymbol,
/* 0x59 */ XK_F14, NoSymbol,
/* 0x5a */ XK_F15, NoSymbol,
/* 0x5b */ XK_F16, NoSymbol,
/* 0x5c */ XK_F17, NoSymbol,
/* 0x5d */ XK_F18, NoSymbol,
/* 0x5e */ XK_F19, NoSymbol,
/* 0x5f */ XK_F20, NoSymbol,
/* 0x60 */ XK_KP_Enter, NoSymbol,
/* 0x61 */ XK_Control_R, NoSymbol,
/* 0x62 */ XK_KP_Divide, NoSymbol,
/* 0x63 */ XK_Print, XK_Sys_Req,
/* 0x64 */ XK_Alt_R, XK_Meta_R,
/* 0x65 */ NoSymbol, NoSymbol, /* KEY_LINEFEED */
/* 0x66 */ XK_Home, NoSymbol,
/* 0x67 */ XK_Up, NoSymbol,
/* 0x68 */ XK_Prior, NoSymbol,
/* 0x69 */ XK_Left, NoSymbol,
/* 0x6a */ XK_Right, NoSymbol,
/* 0x6b */ XK_End, NoSymbol,
/* 0x6c */ XK_Down, NoSymbol,
/* 0x6d */ XK_Next, NoSymbol,
/* 0x6e */ XK_Insert, NoSymbol,
/* 0x6f */ XK_Delete, NoSymbol,
/* 0x70 */ NoSymbol, NoSymbol, /* KEY_MACRO */
/* 0x71 */ NoSymbol, NoSymbol,
/* 0x72 */ NoSymbol, NoSymbol,
/* 0x73 */ NoSymbol, NoSymbol,
/* 0x74 */ NoSymbol, NoSymbol,
/* 0x75 */ XK_KP_Equal, NoSymbol,
/* 0x76 */ NoSymbol, NoSymbol,
/* 0x77 */ NoSymbol, NoSymbol,
/* 0x78 */ XK_F21, NoSymbol,
/* 0x79 */ XK_F22, NoSymbol,
/* 0x7a */ XK_F23, NoSymbol,
/* 0x7b */ XK_F24, NoSymbol,
/* 0x7c */ XK_KP_Separator, NoSymbol,
/* 0x7d */ XK_Meta_L, NoSymbol,
/* 0x7e */ XK_Meta_R, NoSymbol,
/* 0x7f */ XK_Multi_key, NoSymbol,
/* 0x80 */ NoSymbol, NoSymbol,
/* 0x81 */ NoSymbol, NoSymbol,
/* 0x82 */ NoSymbol, NoSymbol,
/* 0x83 */ NoSymbol, NoSymbol,
/* 0x84 */ NoSymbol, NoSymbol,
/* 0x85 */ NoSymbol, NoSymbol,
/* 0x86 */ NoSymbol, NoSymbol,
/* 0x87 */ NoSymbol, NoSymbol,
/* 0x88 */ NoSymbol, NoSymbol,
/* 0x89 */ NoSymbol, NoSymbol,
/* 0x8a */ NoSymbol, NoSymbol,
/* 0x8b */ NoSymbol, NoSymbol,
/* 0x8c */ NoSymbol, NoSymbol,
/* 0x8d */ NoSymbol, NoSymbol,
/* 0x8e */ NoSymbol, NoSymbol,
/* 0x8f */ NoSymbol, NoSymbol,
/* 0x90 */ NoSymbol, NoSymbol,
/* 0x91 */ NoSymbol, NoSymbol,
/* 0x92 */ NoSymbol, NoSymbol,
/* 0x93 */ NoSymbol, NoSymbol,
/* 0x94 */ NoSymbol, NoSymbol,
/* 0x95 */ NoSymbol, NoSymbol,
/* 0x96 */ NoSymbol, NoSymbol,
/* 0x97 */ NoSymbol, NoSymbol,
/* 0x98 */ NoSymbol, NoSymbol,
/* 0x99 */ NoSymbol, NoSymbol,
/* 0x9a */ NoSymbol, NoSymbol,
/* 0x9b */ NoSymbol, NoSymbol,
/* 0x9c */ NoSymbol, NoSymbol,
/* 0x9d */ NoSymbol, NoSymbol,
/* 0x9e */ NoSymbol, NoSymbol,
/* 0x9f */ NoSymbol, NoSymbol,
/* 0xa0 */ NoSymbol, NoSymbol,
/* 0xa1 */ NoSymbol, NoSymbol,
/* 0xa2 */ NoSymbol, NoSymbol,
/* 0xa3 */ NoSymbol, NoSymbol,
/* 0xa4 */ NoSymbol, NoSymbol,
/* 0xa5 */ NoSymbol, NoSymbol,
/* 0xa6 */ NoSymbol, NoSymbol,
/* 0xa7 */ NoSymbol, NoSymbol,
/* 0xa8 */ NoSymbol, NoSymbol,
/* 0xa9 */ NoSymbol, NoSymbol,
/* 0xaa */ NoSymbol, NoSymbol,
/* 0xab */ NoSymbol, NoSymbol,
/* 0xac */ NoSymbol, NoSymbol,
/* 0xad */ NoSymbol, NoSymbol,
/* 0xae */ NoSymbol, NoSymbol,
/* 0xaf */ NoSymbol, NoSymbol,
/* 0xb0 */ NoSymbol, NoSymbol,
/* 0xb1 */ NoSymbol, NoSymbol,
/* 0xb2 */ NoSymbol, NoSymbol,
/* 0xb3 */ NoSymbol, NoSymbol,
/* 0xb4 */ NoSymbol, NoSymbol,
/* 0xb5 */ NoSymbol, NoSymbol,
/* 0xb6 */ NoSymbol, NoSymbol,
/* 0xb7 */ NoSymbol, NoSymbol,
/* 0xb8 */ NoSymbol, NoSymbol,
/* 0xb9 */ NoSymbol, NoSymbol,
/* 0xba */ NoSymbol, NoSymbol,
/* 0xbb */ NoSymbol, NoSymbol,
/* 0xbc */ NoSymbol, NoSymbol,
/* 0xbd */ NoSymbol, NoSymbol,
/* 0xbe */ NoSymbol, NoSymbol,
/* 0xbf */ NoSymbol, NoSymbol,
/* 0xc0 */ NoSymbol, NoSymbol,
/* 0xc1 */ NoSymbol, NoSymbol,
/* 0xc2 */ NoSymbol, NoSymbol,
/* 0xc3 */ NoSymbol, NoSymbol,
/* 0xc4 */ NoSymbol, NoSymbol,
/* 0xc5 */ NoSymbol, NoSymbol,
/* 0xc6 */ NoSymbol, NoSymbol,
/* 0xc7 */ NoSymbol, NoSymbol,
/* 0xc8 */ NoSymbol, NoSymbol,
/* 0xc9 */ NoSymbol, NoSymbol,
/* 0xca */ NoSymbol, NoSymbol,
/* 0xcb */ NoSymbol, NoSymbol,
/* 0xcc */ NoSymbol, NoSymbol,
/* 0xcd */ NoSymbol, NoSymbol,
/* 0xce */ NoSymbol, NoSymbol,
/* 0xcf */ NoSymbol, NoSymbol,
/* 0xd0 */ NoSymbol, NoSymbol,
/* 0xd1 */ NoSymbol, NoSymbol,
/* 0xd2 */ NoSymbol, NoSymbol,
/* 0xd3 */ NoSymbol, NoSymbol,
/* 0xd4 */ NoSymbol, NoSymbol,
/* 0xd5 */ NoSymbol, NoSymbol,
/* 0xd6 */ NoSymbol, NoSymbol,
/* 0xd7 */ NoSymbol, NoSymbol,
/* 0xd8 */ NoSymbol, NoSymbol,
/* 0xd9 */ NoSymbol, NoSymbol,
/* 0xda */ NoSymbol, NoSymbol,
/* 0xdb */ NoSymbol, NoSymbol,
/* 0xdc */ NoSymbol, NoSymbol,
/* 0xdd */ NoSymbol, NoSymbol,
/* 0xde */ NoSymbol, NoSymbol,
/* 0xdf */ NoSymbol, NoSymbol,
/* 0xe0 */ NoSymbol, NoSymbol,
/* 0xe1 */ NoSymbol, NoSymbol,
/* 0xe2 */ NoSymbol, NoSymbol,
/* 0xe3 */ NoSymbol, NoSymbol,
/* 0xe4 */ NoSymbol, NoSymbol,
/* 0xe5 */ NoSymbol, NoSymbol,
/* 0xe6 */ NoSymbol, NoSymbol,
/* 0xe7 */ NoSymbol, NoSymbol,
/* 0xe8 */ NoSymbol, NoSymbol,
/* 0xe9 */ NoSymbol, NoSymbol,
/* 0xea */ NoSymbol, NoSymbol,
/* 0xeb */ NoSymbol, NoSymbol,
/* 0xec */ NoSymbol, NoSymbol,
/* 0xed */ NoSymbol, NoSymbol,
/* 0xee */ NoSymbol, NoSymbol,
/* 0xef */ NoSymbol, NoSymbol,
/* 0xf0 */ NoSymbol, NoSymbol,
/* 0xf1 */ NoSymbol, NoSymbol,
/* 0xf2 */ NoSymbol, NoSymbol,
/* 0xf3 */ NoSymbol, NoSymbol,
/* 0xf4 */ NoSymbol, NoSymbol,
/* 0xf5 */ NoSymbol, NoSymbol,
/* 0xf6 */ NoSymbol, NoSymbol,
/* 0xf7 */ NoSymbol, NoSymbol,
};
static struct { KeySym keysym; CARD8 mask; } modifiers[] = {
{ XK_Shift_L, ShiftMask },
{ XK_Shift_R, ShiftMask },
{ XK_Control_L, ControlMask },
{ XK_Control_R, ControlMask },
{ XK_Caps_Lock, LockMask },
{ XK_Alt_L, AltMask },
{ XK_Alt_R, AltMask },
{ XK_Meta_L, Mod4Mask },
{ XK_Meta_R, Mod4Mask },
{ XK_Num_Lock, NumLockMask },
{ XK_Scroll_Lock, ScrollLockMask },
{ XK_Mode_switch, AltLangMask }
};
#endif
static void
jstkKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl)
{
@ -71,11 +346,46 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
XkbSrvInfoPtr xkbi;
XkbControlsPtr ctrls;
if (!InitKeyboardDeviceStruct(pJstk, &priv->rmlvo, NULL, jstkKbdCtrl))
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 5
{
ErrorF("unable to init keyboard device\n");
return !Success;
if (!InitKeyboardDeviceStruct(pJstk, &priv->rmlvo, NULL, jstkKbdCtrl))
{
ErrorF("unable to init keyboard device\n");
return !Success;
}
}
#else
KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH];
KeySym sym;
int i, j;
XkbComponentNamesRec xkbnames;
memset(modMap, 0, sizeof(modMap));
memset(&xkbnames, 0, sizeof(xkbnames));
keySyms.map = map;
keySyms.mapWidth = GLYPHS_PER_KEY;
keySyms.minKeyCode = MIN_KEYCODE;
keySyms.maxKeyCode = MIN_KEYCODE + (sizeof(map) / sizeof(map[0])) / GLYPHS_PER_KEY - 1;
for (i = 0; i < (sizeof(map) / sizeof(map[0])) / GLYPHS_PER_KEY; i++) {
sym = map[i * GLYPHS_PER_KEY];
for (j = 0; j < sizeof(modifiers)/sizeof(modifiers[0]); j++) {
if (modifiers[j].keysym == sym)
modMap[i + MIN_KEYCODE] = modifiers[j].mask;
}
}
ErrorF("%s, %s, %s, %s, %s\n", priv->rmlvo.rules, priv->rmlvo.model, priv->rmlvo.layout, priv->rmlvo.variant, priv->rmlvo.options);
XkbSetRulesDflts(priv->rmlvo.rules, priv->rmlvo.model,
priv->rmlvo.layout, priv->rmlvo.variant,
priv->rmlvo.options);
if (!XkbInitKeyboardDeviceStruct(pJstk, &xkbnames,
&keySyms, modMap, NULL,
jstkKbdCtrl))
return !Success;
#endif
/* Set Autorepeat and Delay */
if ((priv->repeat_delay || priv->repeat_interval) &&
@ -107,7 +417,7 @@ jstkInitKeys(DeviceIntPtr pJstk, JoystickDevPtr priv)
***************************************************************************
*/
void
jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed)
jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed)
{
int i;
unsigned int k;
@ -137,12 +447,11 @@ jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed)
*
***************************************************************************
*/
Bool
static Bool
jstkKeyboardDeviceControlProc(DeviceIntPtr dev,
int what)
{
InputInfoPtr pInfo = dev->public.devicePrivate;
JoystickDevPtr priv = pInfo->private;
JoystickDevPtr priv = (JoystickDevPtr)XI_PRIVATE(dev);
if (!priv) {
DBG(2, ErrorF("jstkKeyboardDeviceControlProc: priv == NULL\n"));
return !Success;
@ -180,116 +489,65 @@ jstkKeyboardDeviceControlProc(DeviceIntPtr dev,
*
* jstkKeyboardPreInit --
*
* See comment in jstkCorePreInit() for details.
* Called manually to create a keyboard device for the joystick
*
***************************************************************************
*/
int jstkKeyboardPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
{
JoystickDevPtr priv = NULL;
char *s;
pInfo->private = priv = calloc(1, sizeof(JoystickDevRec));
if (!priv)
return BadAlloc;
pInfo->device_control = jstkKeyboardDeviceControlProc;
pInfo->read_input = NULL;
pInfo->control_proc = NULL;
pInfo->switch_mode = NULL;
pInfo->fd = -1;
pInfo->type_name = XI_JOYSTICK;
/* parse keyboard-related options */
priv->repeat_delay = 0;
priv->repeat_interval = 0;
/* Parse option for autorepeat */
if ((s = xf86SetStrOption(pInfo->options, "AutoRepeat", NULL))) {
int delay, rate;
if (sscanf(s, "%d %d", &delay, &rate) != 2) {
xf86Msg(X_ERROR, "%s: \"%s\" is not a valid AutoRepeat value",
pInfo->name, s);
} else {
priv->repeat_delay = delay;
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));
}
free(s);
}
priv->rmlvo.rules = xf86SetStrOption(pInfo->options, "xkb_rules", NULL);
if (!priv->rmlvo.rules)
priv->rmlvo.rules = xf86SetStrOption(pInfo->options, "XkbRules", "evdev");
priv->rmlvo.model = xf86SetStrOption(pInfo->options, "xkb_model", NULL);
if (!priv->rmlvo.model)
priv->rmlvo.model = xf86SetStrOption(pInfo->options, "XkbModel", "evdev");
priv->rmlvo.layout = xf86SetStrOption(pInfo->options, "xkb_layout", NULL);
if (!priv->rmlvo.layout)
priv->rmlvo.layout = xf86SetStrOption(pInfo->options, "XkbLayout", "us");
priv->rmlvo.variant = xf86SetStrOption(pInfo->options, "xkb_variant", NULL);
if (!priv->rmlvo.variant)
priv->rmlvo.variant = xf86SetStrOption(pInfo->options, "XkbVariant", "");
priv->rmlvo.options = xf86SetStrOption(pInfo->options, "xkb_options", NULL);
if (!priv->rmlvo.options)
priv->rmlvo.options = xf86SetStrOption(pInfo->options, "XkbOptions", "");
return Success;
}
InputInfoPtr
jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr _dev, int flags)
{
int rc;
LocalDevicePtr local = NULL;
IDevPtr dev = NULL;
char name[512] = {0};
InputAttributes *attrs = NULL;
InputOption *options;
InputOption *iopts = NULL, *tmp;
DeviceIntPtr dev;
/* duplicate option list, append to name */
options = xf86OptionListDuplicate(pInfo->options);
strcpy(name, pInfo->name);
local = xf86AllocateInput(drv, 0);
if (!local) {
goto SetupProc_fail;
}
dev = xcalloc(sizeof(IDevRec), 1);
strcpy(name, _dev->identifier);
strcat(name, " (keys)");
options = xf86ReplaceStrOption(options, "Name", name);
options = xf86ReplaceStrOption(options, "_source", "_driver/joystick");
dev->identifier = xstrdup(name);
dev->driver = xstrdup(_dev->driver);
dev->commonOptions = (pointer)xf86optionListDup(_dev->commonOptions);
dev->extraOptions = (pointer)xf86optionListDup(_dev->extraOptions);
while(options)
{
tmp = calloc(1, sizeof(InputOption));
local->name = dev->identifier;
local->flags = XI86_KEYBOARD_CAPABLE;
local->device_control = jstkKeyboardDeviceControlProc;
local->read_input = NULL;
local->close_proc = NULL;
local->control_proc = NULL;
local->switch_mode = NULL;
local->conversion_proc = NULL;
local->fd = -1;
local->dev = NULL;
local->private = NULL;
local->type_name = XI_JOYSTICK;
local->history_size = 0;
local->always_core_feedback = 0;
local->conf_idev = dev;
tmp->key = xf86OptionName(options);
tmp->value = xf86OptionValue(options);
tmp->next = iopts;
iopts = tmp;
options = xf86NextOption(options);
xf86CollectInputOptions(local, NULL, NULL);
xf86OptionListReport(local->options);
xf86ProcessCommonOptions(local, local->options);
/* return the LocalDevice */
local->flags |= XI86_CONFIGURED;
return (local);
SetupProc_fail:
if (local)
local->private = NULL;
if (dev) {
if (dev->identifier) xfree(dev->identifier);
if (dev->driver) xfree(dev->driver);
xfree(dev);
}
/* duplicate attribute list */
attrs = DuplicateInputAttributes(pInfo->attrs);
rc = NewInputDeviceRequest(iopts, attrs, &dev);
while(iopts)
{
tmp = iopts->next;
free(iopts->key);
free(iopts->value);
free(iopts);
iopts = tmp;
}
FreeInputAttributes(attrs);
return (rc == Success) ? dev->public.devicePrivate : NULL;
return NULL;
}
@ -304,15 +562,15 @@ jstkKeyboardHotplug(InputInfoPtr pInfo, int flags)
*/
void
jstkKeyboardUnInit(InputDriverPtr drv,
InputInfoPtr pInfo,
LocalDevicePtr local,
int flags)
{
JoystickDevPtr device = (JoystickDevPtr) pInfo->private;
JoystickDevPtr device = (JoystickDevPtr) local->private;
DBG(2, ErrorF("jstkKeyboardUnInit.\n"));
device->keyboard_device = NULL;
pInfo->private = NULL;
local->private = NULL;
xf86DeleteInput(pInfo, 0);
xf86DeleteInput(local, 0);
}

View File

@ -25,10 +25,9 @@
#ifndef __JSTK_KEY_H_INCLUDED__
#define __JSTK_KEY_H_INCLUDED__
void jstkGenerateKeys(InputInfoPtr device, KEYSCANCODES keys, char pressed);
void jstkGenerateKeys(LocalDevicePtr device, KEYSCANCODES keys, char pressed);
InputInfoPtr jstkKeyboardPreInit(InputDriverPtr drv, IDevPtr dev, int flags);
void jstkKeyboardUnInit(InputDriverPtr drv, LocalDevicePtr local, int flags);
int jstkKeyboardPreInit(InputDriverPtr pInfo, InputInfoPtr dev, int flags);
void jstkKeyboardUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags);
Bool jstkKeyboardDeviceControlProc(DeviceIntPtr dev, int what);
InputInfoPtr jstkKeyboardHotplug(InputInfoPtr dev, int flags);
#endif

View File

@ -26,7 +26,6 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -155,7 +154,7 @@ jstkParseButtonOption(const char* org,
xf86Msg(X_WARNING, "%s: error parsing button parameter.\n",
name);
}
free(param);
xfree(param);
}
@ -293,5 +292,5 @@ jstkParseAxisOption(const char* org,
}else xf86Msg(X_WARNING, "%s: error parsing deadzone.\n",
name);
}
free(param);
xfree(param);
}

View File

@ -25,9 +25,12 @@
#include "config.h"
#endif
#include <xorg-server.h>
#include <xf86Module.h>
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
#include <misc.h>
#include <xf86.h>
#include <X11/Xatom.h>
@ -453,3 +456,5 @@ jstkInitProperties(DeviceIntPtr pJstk, JoystickDevPtr priv)
return TRUE;
}
#endif