Compare commits

..

30 Commits

Author SHA1 Message Date
Peter Hutterer
7ef4e2c5e1 evdev 2.1 RC 3
That's it, no more new features. Now it's down to bugfixing only.
2008-11-03 13:47:15 +10:30
Peter Hutterer
dd0eeacc24 Add support for axes swapping.
New option: SwapAxes (boolean)
New property: EVDEV_PROP_SWAP_AXES.

Actual swapping code written by Donnie Berkholz.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 4826969f23)
2008-11-03 13:46:40 +10:30
Peter Hutterer
67c0ea6c94 Add support for run-time calibration.
Some devices require run-time axis calibration. We can't change the min/max
ranges once we've initialised the valuator structs though, so in-driver
run-time calibration is required.

If the property is set, the driver scales from the calibrated range to the
values reported to the X server (which then may scale to screen coordinates).
If the property is not set (i.e. zero items) no scaling is performed.
(cherry picked from commit 33eb36f266)
2008-11-03 13:46:39 +10:30
Peter Hutterer
6bcbbc0411 Treat BTN_[0-2] as LMR buttons if necessary.
Treat BTN_[0-2] as LMR buttons on devices that do not advertise BTN_LEFT,
BTN_MIDDLE, BTN_RIGHT (e.g. 3Dconnexion SpaceNavigator).

Otherwise, treat BTN_[0+n] as button 5+n. Note: This causes duplicate
mappings for BTN_0 + n and  BTN_SIDE + n.

This also fixes a bug where we could end up with negative button numbers after
trying to map BTN_0.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit 64554e4799)
2008-11-03 13:46:35 +10:30
Peter Hutterer
534a3734d0 Remove obsolete FIXME
xkeyboard-config's maps are perfectly able to cope with evdev now.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit b77f939857)
2008-11-03 13:46:35 +10:30
Peter Hutterer
215c230d5c Flush input after re-opening the fd.
Suggested by Julien Cristau.

Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
(cherry picked from commit a43ab4999b)
2008-11-03 13:46:33 +10:30
Peter Hutterer
8f96530449 emuMB: add EvdevMBEmuOn and call from EvdevOn to register wakeup handlers.
This got broken in b0737bdbd1, when the
EmuMBPreInit call was removed from EvdevOn. As a result, VT switching away and
back wouldn't restore the wakeup handlers and mouse button presses
disappeared.
(cherry picked from commit af096e8c5d)
2008-11-03 13:46:31 +10:30
Peter Hutterer
4fb97edcd4 Fix axis inversion for absolute coordinates.
If min_x/y was not equal to 0, the inverted calculated range was off and leads
to inaccessible or out-of-range areas.
(cherry picked from commit 12498042fc)
2008-11-03 13:46:25 +10:30
Peter Hutterer
4e86393bc0 emulate MB: fix confusing log message.
If we're forcing MB emulation behaviour as per config, then at least state
whether we're forcing it off or on.

Found by Michel Dänzer.
(cherry picked from commit 0f8fcfccb3)
2008-11-03 13:46:17 +10:30
Peter Hutterer
a64a78791f evdev 2.1 RC 2 2008-10-23 17:16:36 +10:30
Peter Hutterer
09b2a5e87b Silence compiler warning by memsetting the struct properly.
(cherry picked from commit 0ab4c09e50)
2008-10-23 17:15:32 +10:30
Peter Hutterer
fa18a4a38d MB emulation timeout is stored as Time, make the property 32-bit too.
(cherry picked from commit d348eb8ce7)
2008-10-23 17:15:30 +10:30
Peter Hutterer
172523d745 Init ioctl bitmasks to 0, shuts up valgrind too.
(cherry picked from commit 2c1698fa61)
2008-10-23 17:15:28 +10:30
Søren Hauberg
8fb820ffaf Add touchscreen support.
Touchscreens are devices that do not have buttons and only advertise
BTN_TOUCH. Add a new flag to note the device type.

If BTN_TOUCH is detected, change it to BTN_LEFT and process it normally.
(cherry picked from commit 8c39302594)
2008-10-23 17:15:25 +10:30
Julien Cristau
c7893b212d Fix TestBit() on 64bit
Reported by Albert Damen <albrt@gmx.net>
X.Org Bug#18150 <http://bugs.freedesktop.org/show_bug.cgi?id=18150>
(cherry picked from commit f57e8face9)
2008-10-23 17:14:52 +10:30
Peter Hutterer
e9dd721e2d Add option "GrabDevice", don't grab the device by default.
We now have the matching code in the server to set the console to RAW mode and
don't need to grab the devices anymore.

This is an updated version of e8534d47c8, which
was reverted in 6dc4199155.
(cherry picked from commit 4912e2aa7f)
2008-10-23 17:14:49 +10:30
Peter Hutterer
cab104fd9e Don't post keycodes > 255.
If we only have keys > 255 we don't set up a key class rec, so don't post
them. It makes the server unhappy.

Signed-off-by: Julien Cristau <jcristau@debian.org>
(cherry picked from commit 7243116f55)
2008-10-23 17:14:45 +10:30
Peter Hutterer
708eb34599 evdev 2.1 RC 1. 2008-10-14 17:19:58 +10:30
Peter Hutterer
36a687796f Fix "Device reopened after N attempts" message.
(cherry picked from commit 0089d931ac)
2008-10-14 17:18:08 +10:30
Peter Hutterer
26229df106 Don't init draglock, etc. if we don't have the required capabilities.
(cherry picked from commit 0f5a5ac09e)
2008-10-14 17:18:07 +10:30
Peter Hutterer
f4616d87fc 8-bit properties should use 8-bit storage types...
(cherry picked from commit 36d68b006d)
2008-10-14 17:18:07 +10:30
Peter Hutterer
2aa5ca8cdd Don't include the client-side header anymore. xkbstr.h is server SDK.
(cherry picked from commit bb1f421687)
2008-10-14 17:18:07 +10:30
Peter Hutterer
39263dc65d Tidy up evdev.h
This includes shuffling some functions around so we don't need the prototypes
in evdev.h.
(cherry picked from commit 0405f7b17f)
2008-10-14 17:18:07 +10:30
Peter Hutterer
57521e4e60 Rename DragLockInit to DragLockPreInit, remove superfluous "return".
(cherry picked from commit 088e0a175a)
2008-10-14 17:18:07 +10:30
Peter Hutterer
7da1522309 Register property handler from within the modules, not the main evdev file.
(cherry picked from commit cefedeb205)
2008-10-14 17:18:07 +10:30
Peter Hutterer
b4fcb825fc Clean up program flow - don't call PreInit for "modules" on DEVICE_INIT.
Call the PreInit functions for MB Emulation, wheel emu, and draglock during
PreInit, not on DEVICE_INIT. This way, we only parse the options once and
don't overwrite with defaults when coming back from a VT switch.
(cherry picked from commit b0737bdbd1)
2008-10-14 17:18:07 +10:30
Peter Hutterer
7c955ad050 Janitor: clean up xf86Msg use, might as well use X_CONFIG directly.
(cherry picked from commit 5f2c8a2dcd)
2008-10-14 17:18:07 +10:30
Peter Hutterer
4f80c0f2cb Add property support for ReopenAttempts option.
(cherry picked from commit ff783fce65)
2008-10-14 17:18:07 +10:30
Peter Hutterer
5070d64aa8 Document properties in man page.
(cherry picked from commit c638aa4a88)
2008-10-14 17:18:07 +10:30
Peter Hutterer
caacacf057 Document InvertX/Y options.
(cherry picked from commit b46677e346)
2008-10-14 17:18:07 +10:30
15 changed files with 689 additions and 1774 deletions

19
.cvsignore Normal file
View File

@@ -0,0 +1,19 @@
Makefile
Makefile.in
*.la
*.lo
aclocal.m4
autom4te.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1

5
.gitignore vendored
View File

@@ -22,7 +22,6 @@ missing
*.lo *.lo
*.la *.la
stamp-h1 stamp-h1
xf86-input-evdev-*.tar.* *.bz2
*.gz
*.pc *.pc
*~
tags

View File

@@ -19,22 +19,19 @@
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
# Ensure headers are installed below $(prefix) for distcheck
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
SUBDIRS = src man include SUBDIRS = src man include
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = xorg-evdev.pc pkgconfig_DATA = xorg-evdev.pc
EXTRA_DIST = ChangeLog EXTRA_DIST = ChangeLog autogen.sh
MAINTAINERCLEANFILES=ChangeLog MAINTAINERCLEANFILES=ChangeLog
.PHONY: ChangeLog .PHONY: ChangeLog
ChangeLog: ChangeLog:
$(CHANGELOG_CMD) (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || \
(touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
dist-hook: ChangeLog dist-hook: ChangeLog

20
README
View File

@@ -1,20 +0,0 @@
xf86-input-evdev - Generic Linux input driver for the Xorg X server
Please submit bugs & patches to the Xorg bugzilla:
https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
All questions regarding this software should be directed at the
Xorg mailing list:
http://lists.freedesktop.org/mailman/listinfo/xorg
The master development code repository can be found at:
git://anongit.freedesktop.org/git/xorg/driver/xf86-input-evdev
http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev
For more information on the git code manager, see:
http://wiki.x.org/wiki/GitPage

View File

@@ -22,7 +22,7 @@
AC_PREREQ(2.57) AC_PREREQ(2.57)
AC_INIT([xf86-input-evdev], AC_INIT([xf86-input-evdev],
2.3.3, 2.0.99.3,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-evdev) xf86-input-evdev)
@@ -32,16 +32,15 @@ AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
# Require xorg-macros: XORG_DEFAULT_OPTIONS DRIVER_NAME=evdev
m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])]) AC_SUBST([DRIVER_NAME])
XORG_MACROS_VERSION(1.3)
AM_CONFIG_HEADER([config.h]) AM_CONFIG_HEADER([config.h])
# Checks for programs. # Checks for programs.
AC_DISABLE_STATIC AC_DISABLE_STATIC
AC_PROG_LIBTOOL AC_PROG_LIBTOOL
AC_PROG_CC AC_PROG_CC
XORG_DEFAULT_OPTIONS
AH_TOP([#include "xorg-server.h"]) AH_TOP([#include "xorg-server.h"])
@@ -53,22 +52,24 @@ AC_ARG_WITH(xorg-module-dir,
inputdir=${moduledir}/input inputdir=${moduledir}/input
AC_SUBST(inputdir) AC_SUBST(inputdir)
# Checks for pkg-config packages. We need to be able to override sdkdir # Checks for extensions
# to satisfy silly distcheck requirements. XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
# Checks for pkg-config packages
PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES) PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS" sdkdir=$(pkg-config --variable=sdkdir xorg-server)
AC_ARG_WITH([sdkdir], [], AC_SUBST(sdkdir)
[sdkdir="$withval"],
[sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`]) CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
AC_SUBST([sdkdir]) AC_SUBST([CFLAGS])
# Checks for libraries. # Checks for libraries.
# Checks for header files. # Checks for header files.
AC_HEADER_STDC AC_HEADER_STDC
DRIVER_NAME=evdev XORG_MANPAGE_SECTIONS
AC_SUBST([DRIVER_NAME]) XORG_RELEASE_VERSION
AC_OUTPUT([Makefile AC_OUTPUT([Makefile
src/Makefile src/Makefile

View File

@@ -43,7 +43,7 @@
#define EVDEV_PROP_WHEEL_INERTIA "Evdev Wheel Emulation Inertia" #define EVDEV_PROP_WHEEL_INERTIA "Evdev Wheel Emulation Inertia"
/* CARD16 */ /* CARD16 */
#define EVDEV_PROP_WHEEL_TIMEOUT "Evdev Wheel Emulation Timeout" #define EVDEV_PROP_WHEEL_TIMEOUT "Evdev Wheel Emulation Timeout"
/* CARD8, value range 0-32, 0 to always scroll */ /* CARD8, value range 0-32, 0 to disable a value */
#define EVDEV_PROP_WHEEL_BUTTON "Evdev Wheel Emulation Button" #define EVDEV_PROP_WHEEL_BUTTON "Evdev Wheel Emulation Button"
/* Drag lock */ /* Drag lock */

2
man/.cvsignore Normal file
View File

@@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@@ -44,6 +44,22 @@ The following driver
.B Options .B Options
are supported: are supported:
.TP 7 .TP 7
.BI "Option \*qDevice\*q \*q" string \*q
Specifies the device through which the device can be accessed. This will
generally be of the form \*q/dev/input/eventX\*q, where X is some integer.
The mapping from device node to hardware is system-dependent.
.TP 7
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
Enable/disable the emulation of the third (middle) mouse button for mice
which only have two physical buttons. The third button is emulated by
pressing both buttons simultaneously. Default: on, until a middle mouse
button event is registered. Property: "Evdev Middle Button Emulation".
.TP 7
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
Sets the timeout (in milliseconds) that the driver waits before deciding
if two buttons where pressed "simultaneously" when 3 button emulation is
enabled. Default: 50. Property: "Evdev Middle Button Timeout".
.TP 7
.BI "Option \*qButtonMapping\*q \*q" string \*q .BI "Option \*qButtonMapping\*q \*q" string \*q
Sets the button mapping for this device. The mapping is a space-separated list Sets the button mapping for this device. The mapping is a space-separated list
of button mappings that correspond in order to the physical buttons on the of button mappings that correspond in order to the physical buttons on the
@@ -54,11 +70,6 @@ For example, a left-handed mouse with deactivated scroll-wheel would use a
mapping of "3 2 1 0 0". Invalid mappings are ignored and the default mapping mapping of "3 2 1 0 0". Invalid mappings are ignored and the default mapping
is used. Buttons not specified in the user's mapping use the default mapping. is used. Buttons not specified in the user's mapping use the default mapping.
.TP 7 .TP 7
.BI "Option \*qDevice\*q \*q" string \*q
Specifies the device through which the device can be accessed. This will
generally be of the form \*q/dev/input/eventX\*q, where X is some integer.
The mapping from device node to hardware is system-dependent.
.TP 7
.BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q .BI "Option \*qDragLockButtons\*q \*q" "L1 B2 L3 B4" \*q
Sets \*qdrag lock buttons\*q that simulate holding a button down, so Sets \*qdrag lock buttons\*q that simulate holding a button down, so
that low dexterity people do not have to hold a button down at the that low dexterity people do not have to hold a button down at the
@@ -72,18 +83,6 @@ Sets a \*qmaster drag lock button\*q that acts as a \*qMeta Key\*q
indicating that the next button pressed is to be indicating that the next button pressed is to be
\*qdrag locked\*q. Property: "Evdev Drag Lock Buttons". \*qdrag locked\*q. Property: "Evdev Drag Lock Buttons".
.TP 7 .TP 7
.TP 7
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
Enable/disable the emulation of the third (middle) mouse button for mice
which only have two physical buttons. The third button is emulated by
pressing both buttons simultaneously. Default: on, until a middle mouse
button event is registered. Property: "Evdev Middle Button Emulation".
.TP 7
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
Sets the timeout (in milliseconds) that the driver waits before deciding
if two buttons where pressed "simultaneously" when 3 button emulation is
enabled. Default: 50. Property: "Evdev Middle Button Timeout".
.TP 7
.BI "Option \*qEmulateWheel\*q \*q" boolean \*q .BI "Option \*qEmulateWheel\*q \*q" boolean \*q
Enable/disable "wheel" emulation. Wheel emulation means emulating button Enable/disable "wheel" emulation. Wheel emulation means emulating button
press/release events when the mouse is moved while a specific real button press/release events when the mouse is moved while a specific real button
@@ -97,7 +96,7 @@ more buttons but no wheel. See the description of the
.BR XAxisMapping , .BR XAxisMapping ,
and and
.B YAxisMapping .B YAxisMapping
options. Default: off. Property "Evdev Wheel Emulation". options below. Default: off. Property "Evdev Wheel Emulation".
.TP 7 .TP 7
.BI "Option \*qEmulateWheelButton\*q \*q" integer \*q .BI "Option \*qEmulateWheelButton\*q \*q" integer \*q
Specifies which button must be held down to enable wheel emulation mode. Specifies which button must be held down to enable wheel emulation mode.
@@ -106,10 +105,7 @@ press/release events as specified for the
.B XAxisMapping .B XAxisMapping
and and
.B YAxisMapping .B YAxisMapping
settings. If the button is 0 and settings. Default: 4. Property: "Evdev Wheel Emulation Button".
.BR EmulateWheel
is on, any motion of the device is converted into wheel events. Default: 4.
Property: "Evdev Wheel Emulation Button".
.TP 7 .TP 7
.BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q .BI "Option \*qEmulateWheelInertia\*q \*q" integer \*q
Specifies how far (in pixels) the pointer must move to generate button Specifies how far (in pixels) the pointer must move to generate button
@@ -124,49 +120,6 @@ must be pressed before wheel emulation is started. If the
is released before this timeout, the original button press/release event is released before this timeout, the original button press/release event
is sent. Default: 200. Property: "Evdev Wheel Emulation Timeout". is sent. Default: 200. Property: "Evdev Wheel Emulation Timeout".
.TP 7 .TP 7
.BI "Option \*qGrabDevice\*q \*q" boolean \*q
Force a grab on the event device. Doing so will ensure that no other driver
can initialise the same device and it will also stop the device from sending
events to /dev/kbd or /dev/input/mice. Events from this device will not be
sent to virtual devices (e.g. rfkill or the Macintosh mouse button emulation).
Default: disabled.
.TP 7
.BI "Option \*qInvertX\*q \*q" Bool \*q
.TP 7
.BI "Option \*qInvertY\*q \*q" Bool \*q
Invert the given axis. Default: off. Property: "Evdev Axis Inversion".
.TP 7
.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
.TP 7
.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
Ignore the specified type of axis. Default: unset. The X server cannot deal
with devices that have both relative and absolute axes. Evdev tries to guess
wich axes to ignore given the device type and disables absolute axes for
mice and relative axes for tablets, touchscreens and touchpad. These options
allow to forcibly disable an axis type. Mouse wheel axes are exempt and will
work even if relative axes are ignored. No property, this configuration must
be set in the configuration.
.br
If either option is set to False, the driver will not ignore the specified
axes regardless of the presence of other axes. This may trigger buggy
behavior and events from this axis are always forwarded. Users are
discouraged from setting this option.
.TP 7
.BI "Option \*qReopenAttempts\*q \*q" integer \*q
Number of reopen attempts after a read error occurs on the device (e.g. after
waking up from suspend). In between each attempt is a 100ms wait. Default: 10.
.TP 7
.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q
Calibrates the X and Y axes for devices that need to scale to a different
coordinate system than reported to the X server. This feature is required
for devices that need to scale to a different coordinate system than
originally reported by the kernel (e.g. touchscreens). The scaling to the
custom coordinate system is done in-driver and the X server is unaware of
the transformation. Property: "Evdev Axis Calibration".
.TP 7
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
.TP 7
.BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q .BI "Option \*qXAxisMapping\*q \*q" "N1 N2" \*q
Specifies which buttons are mapped to motion in the X direction in wheel Specifies which buttons are mapped to motion in the X direction in wheel
emulation mode. Button number emulation mode. Button number
@@ -184,26 +137,31 @@ is mapped to the negative Y axis motion and button number
.I N2 .I N2
is mapped to the positive Y axis motion. Default: "4 5". Property: is mapped to the positive Y axis motion. Default: "4 5". Property:
"Evdev Wheel Emulation Axes". "Evdev Wheel Emulation Axes".
.TP 7
.BI "Option \*qReopenAttempts\*q \*q" integer \*q
Number of reopen attempts after a read error occurs on the device (e.g. after
waking up from suspend). In between each attempt is a 100ms wait. Default: 10.
.TP 7
.BI "Option \*qInvertX\*q \*q" Bool \*q
.TP 7
.BI "Option \*qInvertY\*q \*q" Bool \*q
Invert the given axis. Default: off. Property: "Evdev Axis Inversion".
.TP 7
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
.TP 7
.BI "Option \*qGrabDevice\*q \*q" boolean \*q
Force a grab on the event device. Doing so will ensure that no other driver
can initialise the same device and it will also stop the device from sending
events to /dev/kbd or /dev/input/mice. Events from this device will not be
sent to virtual devices (e.g. rfkill or the Macintosh mouse button emulation).
Default disabled.
.SH SUPPORTED PROPERTIES .SH SUPPORTED PROPERTIES
The following properties are provided by the The following properties are provided by the
.B evdev .B evdev
driver. driver.
.TP 7 .TP 7
.BI "Evdev Axis Calibration"
4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
in-driver axis calibration.
.TP 7
.BI "Evdev Axis Inversion"
2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
.TP 7
.BI "Evdev Axes Swap"
1 boolean value (8 bit, 0 or 1). 1 swaps x/y axes.
.TP 7
.BI "Evdev Drag Lock Buttons"
8-bit. Either 1 value or pairs of values. Value range 0-32, 0 disables a
value.
.TP 7
.BI "Evdev Middle Button Emulation" .BI "Evdev Middle Button Emulation"
1 boolean value (8 bit, 0 or 1). 1 boolean value (8 bit, 0 or 1).
.TP 7 .TP 7
@@ -216,17 +174,32 @@ value.
.BI "Evdev Wheel Emulation Axes" .BI "Evdev Wheel Emulation Axes"
4 8-bit values, order X up, X down, Y up, Y down. 0 disables a value. 4 8-bit values, order X up, X down, Y up, Y down. 0 disables a value.
.TP 7 .TP 7
.BI "Evdev Wheel Emulation Button"
1 8-bit value, allowed range 0-32, 0 disables the button.
.TP 7
.BI "Evdev Wheel Emulation Inertia" .BI "Evdev Wheel Emulation Inertia"
1 16-bit positive value. 1 16-bit positive value.
.TP 7 .TP 7
.BI "Evdev Wheel Emulation Timeout" .BI "Evdev Wheel Emulation Timeout"
1 16-bit positive value. 1 16-bit positive value.
.TP 7
.BI "Evdev Wheel Emulation Button"
1 8-bit value, allowed range 0-32, 0 disables the button.
.TP 7
.BI "Evdev Drag Lock Buttons"
8-bit. Either 1 value or pairs of values. Value range 0-32, 0 disables a
value.
.TP 7
.BI "Evdev Axis Inversion"
2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
.BI "Evdev Axis Calibration"
4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
run-time axis calibration. This feature is required for devices that need to
scale to a different coordinate system than originally reported to the X
server, such as touchscreens that require run-time calibration.
.TP 7
.BI "Evdev Axis Swap"
1 boolean values (8 bit, 0 or 1). 1 swaps x/y axes.
.SH AUTHORS .SH AUTHORS
Kristian Høgsberg. Kristian Høgsberg.
.SH "SEE ALSO" .SH "SEE ALSO"
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
README.mouse. README.mouse.

6
src/.cvsignore Normal file
View File

@@ -0,0 +1,6 @@
.deps
.libs
Makefile
Makefile.in
*.la
*.lo

View File

@@ -24,8 +24,6 @@
# -avoid-version prevents gratuitous .0.0.0 version numbers on the end # -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 # _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. # 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_LTLIBRARIES = @DRIVER_NAME@_drv.la
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version @DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
@DRIVER_NAME@_drv_ladir = @inputdir@ @DRIVER_NAME@_drv_ladir = @inputdir@

View File

@@ -147,18 +147,18 @@ EvdevDragLockPreInit(InputInfoPtr pInfo)
} }
} }
/* Updates DragLock button state and fires button event messges */ /* Updates DragLock button state and firest button event messges */
void void
EvdevDragLockLockButton(InputInfoPtr pInfo, unsigned int button) EvdevDragLockLockButton(InputInfoPtr pInfo, unsigned int button)
{ {
EvdevPtr pEvdev = (EvdevPtr)pInfo->private; EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
BOOL state = 0; BOOL state=0;
/* update button state */ /* update button state */
state = pEvdev->dragLock.lock_state[button - 1] ? FALSE : TRUE; state = pEvdev->dragLock.lock_state[button - 1] ? FALSE : TRUE;
pEvdev->dragLock.lock_state[button - 1] = state; pEvdev->dragLock.lock_state[button - 1] = state;
EvdevQueueButtonEvent(pInfo, button, state); xf86PostButtonEvent(pInfo->dev, 0, button, state, 0, 0);
} }
/* Filter button presses looking for either a meta button or the /* Filter button presses looking for either a meta button or the
@@ -217,7 +217,7 @@ EvdevDragLockFilterEvent(InputInfoPtr pInfo, unsigned int button, int value)
* for the pair. 0 disables a pair. * for the pair. 0 disables a pair.
* i.e. to set bt 3 to draglock button 1, supply 0,0,1 * i.e. to set bt 3 to draglock button 1, supply 0,0,1
*/ */
static int int
EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {
@@ -243,9 +243,7 @@ EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
return BadValue; return BadValue;
} }
if (val->size == 0) if (val->size == 1)
return BadMatch;
else if (val->size == 1)
{ {
int meta = *((CARD8*)val->data); int meta = *((CARD8*)val->data);
if (meta > EVDEV_MAXBUTTONS) if (meta > EVDEV_MAXBUTTONS)
@@ -256,7 +254,7 @@ EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
pEvdev->dragLock.meta = meta; pEvdev->dragLock.meta = meta;
memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair)); memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair));
} }
} else if ((val->size % 2) == 0) } else
{ {
CARD8* vals = (CARD8*)val->data; CARD8* vals = (CARD8*)val->data;
@@ -269,11 +267,10 @@ EvdevDragLockSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
pEvdev->dragLock.meta = 0; pEvdev->dragLock.meta = 0;
memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair)); memset(pEvdev->dragLock.lock_pair, 0, sizeof(pEvdev->dragLock.lock_pair));
for (i = 0; i < val->size && i < EVDEV_MAXBUTTONS; i += 2) for (i = 0; i < val->size && i < EVDEV_MAXBUTTONS; i++)
pEvdev->dragLock.lock_pair[vals[i] - 1] = vals[i + 1]; pEvdev->dragLock.lock_pair[i] = vals[i];
} }
} else }
return BadMatch;
} }
return Success; return Success;

View File

@@ -198,7 +198,7 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
pEvdev->emulateMB.pending = FALSE; pEvdev->emulateMB.pending = FALSE;
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) { if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
EvdevPostButtonEvent(pInfo, abs(id), (id >= 0)); xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0);
pEvdev->emulateMB.state = pEvdev->emulateMB.state =
stateTab[pEvdev->emulateMB.state][4][2]; stateTab[pEvdev->emulateMB.state][4][2];
} else { } else {
@@ -231,11 +231,6 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
if (!pEvdev->emulateMB.enabled) if (!pEvdev->emulateMB.enabled)
return ret; return ret;
if (button == 2) {
EvdevMBEmuEnable(pInfo, FALSE);
return ret;
}
/* don't care about other buttons */ /* don't care about other buttons */
if (button != 1 && button != 3) if (button != 1 && button != 3)
return ret; return ret;
@@ -248,12 +243,12 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0) if ((id = stateTab[pEvdev->emulateMB.state][*btstate][0]) != 0)
{ {
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0)); xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0);
ret = TRUE; ret = TRUE;
} }
if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0) if ((id = stateTab[pEvdev->emulateMB.state][*btstate][1]) != 0)
{ {
EvdevQueueButtonEvent(pInfo, abs(id), (id >= 0)); xf86PostButtonEvent(pInfo->dev, 0, abs(id), (id >= 0), 0, 0);
ret = TRUE; ret = TRUE;
} }
@@ -327,9 +322,6 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo)
void void
EvdevMBEmuOn(InputInfoPtr pInfo) EvdevMBEmuOn(InputInfoPtr pInfo)
{ {
if (!pInfo->dev->button) /* don't init for keyboards */
return;
RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler, RegisterBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
EvdevMBEmuWakeupHandler, EvdevMBEmuWakeupHandler,
(pointer)pInfo); (pointer)pInfo);
@@ -338,9 +330,6 @@ EvdevMBEmuOn(InputInfoPtr pInfo)
void void
EvdevMBEmuFinalize(InputInfoPtr pInfo) EvdevMBEmuFinalize(InputInfoPtr pInfo)
{ {
if (!pInfo->dev->button) /* don't cleanup for keyboards */
return;
RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler, RemoveBlockAndWakeupHandlers (EvdevMBEmuBlockHandler,
EvdevMBEmuWakeupHandler, EvdevMBEmuWakeupHandler,
(pointer)pInfo); (pointer)pInfo);
@@ -358,7 +347,7 @@ EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable)
#ifdef HAVE_PROPERTIES #ifdef HAVE_PROPERTIES
static int int
EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {

View File

@@ -54,7 +54,7 @@ static Atom prop_wheel_button = 0;
/* Local Funciton Prototypes */ /* Local Funciton Prototypes */
static BOOL EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char *axis_name); static BOOL EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char *axis_name);
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value); static void EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
/* Filter mouse button events */ /* Filter mouse button events */
BOOL BOOL
@@ -82,7 +82,8 @@ EvdevWheelEmuFilterButton(InputInfoPtr pInfo, unsigned int button, int value)
* If the button is released early enough emit the button * If the button is released early enough emit the button
* press/release events * press/release events
*/ */
EvdevQueueButtonClicks(pInfo, button, 1); xf86PostButtonEvent(pInfo->dev, 0, button, 1, 0, 0);
xf86PostButtonEvent(pInfo->dev, 0, button, 0, 0, 0);
} }
} }
@@ -98,51 +99,38 @@ BOOL
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
{ {
EvdevPtr pEvdev = (EvdevPtr)pInfo->private; EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
WheelAxisPtr pAxis = NULL, pOtherAxis = NULL; WheelAxisPtr pAxis = NULL;
int value = pEv->value; int value = pEv->value;
int ms;
/* Has wheel emulation been configured to be enabled? */ /* Has wheel emulation been configured to be enabled? */
if (!pEvdev->emulateWheel.enabled) if (!pEvdev->emulateWheel.enabled)
return FALSE; return FALSE;
/* Handle our motion events if the emuWheel button is pressed /* Handle our motion events if the emuWheel button is pressed*/
* wheel button of 0 means always emulate wheel. if (pEvdev->emulateWheel.button_state) {
*/
if (pEvdev->emulateWheel.button_state || !pEvdev->emulateWheel.button) {
/* Just return if the timeout hasn't expired yet */ /* Just return if the timeout hasn't expired yet */
if (pEvdev->emulateWheel.button) ms = pEvdev->emulateWheel.expires - GetTimeInMillis();
{ if (ms > 0)
int ms = pEvdev->emulateWheel.expires - GetTimeInMillis(); return TRUE;
if (ms > 0)
return TRUE;
}
/* We don't want to intercept real mouse wheel events */ /* We don't want to intercept real mouse wheel events */
switch(pEv->code) { switch(pEv->code) {
case REL_X: case REL_X:
pAxis = &(pEvdev->emulateWheel.X); pAxis = &(pEvdev->emulateWheel.X);
pOtherAxis = &(pEvdev->emulateWheel.Y);
break; break;
case REL_Y: case REL_Y:
pAxis = &(pEvdev->emulateWheel.Y); pAxis = &(pEvdev->emulateWheel.Y);
pOtherAxis = &(pEvdev->emulateWheel.X);
break; break;
default: default:
break; break;
} }
/* If we found REL_X or REL_Y, emulate a mouse wheel. /* If we found REL_X or REL_Y, emulate a mouse wheel */
Reset the inertia of the other axis when a scroll event was sent
to avoid the buildup of erroneous scroll events if the user
doesn't move in a perfectly straight line.
*/
if (pAxis) if (pAxis)
{ EvdevWheelEmuInertia(pInfo, pAxis, value);
if (EvdevWheelEmuInertia(pInfo, pAxis, value))
pOtherAxis->traveled_distance = 0;
}
/* Eat motion events while emulateWheel button pressed. */ /* Eat motion events while emulateWheel button pressed. */
return TRUE; return TRUE;
@@ -151,20 +139,17 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
return FALSE; return FALSE;
} }
/* Simulate inertia for our emulated mouse wheel. /* Simulate inertia for our emulated mouse wheel */
Returns the number of wheel events generated. static void
*/
static int
EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value) EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
{ {
EvdevPtr pEvdev = (EvdevPtr)pInfo->private; EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
int button; int button;
int inertia; int inertia;
int rc = 0;
/* if this axis has not been configured, just eat the motion */ /* if this axis has not been configured, just eat the motion */
if (!axis->up_button) if (!axis->up_button)
return rc; return;
axis->traveled_distance += value; axis->traveled_distance += value;
@@ -178,11 +163,11 @@ EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
/* Produce button press events for wheel motion */ /* Produce button press events for wheel motion */
while(abs(axis->traveled_distance) > pEvdev->emulateWheel.inertia) { while(abs(axis->traveled_distance) > pEvdev->emulateWheel.inertia) {
axis->traveled_distance -= inertia; axis->traveled_distance -= inertia;
EvdevQueueButtonClicks(pInfo, button, 1); xf86PostButtonEvent(pInfo->dev, 0, button, 1, 0, 0);
rc++; xf86PostButtonEvent(pInfo->dev, 0, button, 0, 0, 0);
} }
return rc;
} }
/* Handle button mapping here to avoid code duplication, /* Handle button mapping here to avoid code duplication,
@@ -216,8 +201,8 @@ EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char* axis_
pAxis->down_button = down_button; pAxis->down_button = down_button;
/* Update the number of buttons if needed */ /* Update the number of buttons if needed */
if (up_button > pEvdev->num_buttons) pEvdev->num_buttons = up_button; if (up_button > pEvdev->buttons) pEvdev->buttons = up_button;
if (down_button > pEvdev->num_buttons) pEvdev->num_buttons = down_button; if (down_button > pEvdev->buttons) pEvdev->buttons = down_button;
} else { } else {
xf86Msg(X_WARNING, "%s: Invalid %s value:\"%s\"\n", xf86Msg(X_WARNING, "%s: Invalid %s value:\"%s\"\n",
@@ -300,8 +285,8 @@ EvdevWheelEmuPreInit(InputInfoPtr pInfo)
/* Simpler to check just the largest value in this case */ /* Simpler to check just the largest value in this case */
/* XXX: we should post this to the server */ /* XXX: we should post this to the server */
if (5 > pEvdev->num_buttons) if (5 > pEvdev->buttons)
pEvdev->num_buttons = 5; pEvdev->buttons = 5;
/* Display default Configuration */ /* Display default Configuration */
xf86Msg(X_CONFIG, "%s: YAxisMapping: buttons %d and %d\n", xf86Msg(X_CONFIG, "%s: YAxisMapping: buttons %d and %d\n",
@@ -326,7 +311,7 @@ EvdevWheelEmuPreInit(InputInfoPtr pInfo)
} }
#ifdef HAVE_PROPERTIES #ifdef HAVE_PROPERTIES
static int int
EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
BOOL checkonly) BOOL checkonly)
{ {
@@ -352,17 +337,24 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
16, PropModeReplace, 1, 16, PropModeReplace, 1,
&pEvdev->emulateWheel.inertia, TRUE); &pEvdev->emulateWheel.inertia, TRUE);
} }
/* Don't enable with negative timeout */
if (pEvdev->emulateWheel.timeout < 0)
{
pEvdev->emulateWheel.timeout = 200;
XIChangeDeviceProperty(dev, prop_wheel_timeout, XA_INTEGER, 16,
PropModeReplace, 1,
&pEvdev->emulateWheel.timeout, TRUE);
}
} }
} }
else if (atom == prop_wheel_button) else if (atom == prop_wheel_button)
{ {
int bt; int bt = *((CARD8*)val->data);
if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER) if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
return BadMatch; return BadMatch;
bt = *((CARD8*)val->data);
if (bt < 0 || bt >= EVDEV_MAXBUTTONS) if (bt < 0 || bt >= EVDEV_MAXBUTTONS)
return BadValue; return BadValue;
@@ -382,13 +374,11 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
} }
} else if (atom == prop_wheel_inertia) } else if (atom == prop_wheel_inertia)
{ {
int inertia; int inertia = *((CARD16*)val->data);
if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER) if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
return BadMatch; return BadMatch;
inertia = *((CARD16*)val->data);
if (inertia < 0) if (inertia < 0)
return BadValue; return BadValue;
@@ -396,13 +386,11 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
pEvdev->emulateWheel.inertia = inertia; pEvdev->emulateWheel.inertia = inertia;
} else if (atom == prop_wheel_timeout) } else if (atom == prop_wheel_timeout)
{ {
int timeout; int timeout = *((CARD16*)val->data);
if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER) if (val->format != 16 || val->size != 1 || val->type != XA_INTEGER)
return BadMatch; return BadMatch;
timeout = *((CARD16*)val->data);
if (timeout < 0) if (timeout < 0)
return BadValue; return BadValue;

File diff suppressed because it is too large Load Diff

View File

@@ -25,62 +25,28 @@
* Kristian Høgsberg (krh@redhat.com) * Kristian Høgsberg (krh@redhat.com)
* Adam Jackson (ajax@redhat.com) * Adam Jackson (ajax@redhat.com)
* Peter Hutterer (peter@cs.unisa.edu.au) * Peter Hutterer (peter@cs.unisa.edu.au)
* Oliver McFadden (oliver.mcfadden@nokia.com)
*/ */
#ifndef EVDEV_H #ifndef EVDEV_H
#define EVDEV_H #define EVDEV_H
#include <linux/input.h> #include <linux/input.h>
#include <linux/types.h>
#include <xf86Xinput.h> #include <xf86Xinput.h>
#include <xf86_OSproc.h> #include <xf86_OSproc.h>
#include <xkbstr.h>
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */ #ifdef XKB
#define EV_CNT (EV_MAX+1) #include <xkbstr.h>
#endif
#ifndef KEY_CNT
#define KEY_CNT (KEY_MAX+1)
#endif
#ifndef REL_CNT
#define REL_CNT (REL_MAX+1)
#endif
#ifndef ABS_CNT
#define ABS_CNT (ABS_MAX+1)
#endif
#ifndef LED_CNT
#define LED_CNT (LED_MAX+1)
#endif #endif
#define EVDEV_MAXBUTTONS 32 #define EVDEV_MAXBUTTONS 32
#define EVDEV_MAXQUEUE 32
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3 #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
#define HAVE_PROPERTIES 1 #define HAVE_PROPERTIES 1
#endif #endif
#ifndef MAX_VALUATORS
#define MAX_VALUATORS 36
#endif
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5
typedef struct {
char *rules;
char *model;
char *layout;
char *variant;
char *options;
} XkbRMLVOSet;
#endif
#define LONG_BITS (sizeof(long) * 8) #define LONG_BITS (sizeof(long) * 8)
#define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
/* Number of longs needed to hold the given number of bits */
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
/* axis specific data for wheel emulation */ /* axis specific data for wheel emulation */
typedef struct { typedef struct {
@@ -89,41 +55,29 @@ typedef struct {
int traveled_distance; int traveled_distance;
} WheelAxis, *WheelAxisPtr; } WheelAxis, *WheelAxisPtr;
/* Event queue used to defer keyboard/button events until EV_SYN time. */
typedef struct {
enum {
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
} type;
int key; /* May be either a key code or button number. */
int val; /* State of the key/button; pressed or released. */
} EventQueueRec, *EventQueuePtr;
typedef struct { typedef struct {
const char *device; const char *device;
int grabDevice; /* grab the event device? */ int grabDevice; /* grab the event device? */
int screen;
int num_vals; /* number of valuators */ int min_x, min_y, max_x, max_y;
int axis_map[max(ABS_CNT, REL_CNT)]; /* Map evdev <axis> to index */ int abs_x, abs_y, old_x, old_y;
int vals[MAX_VALUATORS];
int old_vals[MAX_VALUATORS]; /* Translate absolute inputs to relative */
int flags; int flags;
int tool; int tool;
int num_buttons; /* number of buttons */ int buttons; /* number of buttons */
BOOL swap_axes; BOOL swap_axes;
BOOL invert_x; BOOL invert_x;
BOOL invert_y; BOOL invert_y;
int delta[REL_CNT];
unsigned int abs, rel;
/* XKB stuff has to be per-device rather than per-driver */ /* XKB stuff has to be per-device rather than per-driver */
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 5 int noXkb;
#ifdef XKB
char *xkb_rules;
char *xkb_model;
char *xkb_layout;
char *xkb_variant;
char *xkb_options;
XkbComponentNamesRec xkbnames; XkbComponentNamesRec xkbnames;
#endif #endif
XkbRMLVOSet rmlvo;
/* Middle mouse button emulation */ /* Middle mouse button emulation */
struct { struct {
BOOL enabled; BOOL enabled;
@@ -165,30 +119,14 @@ typedef struct {
/* Cached info from device. */ /* Cached info from device. */
char name[1024]; char name[1024];
unsigned long bitmask[NLONGS(EV_CNT)]; long bitmask[NBITS(EV_MAX)];
unsigned long key_bitmask[NLONGS(KEY_CNT)]; long key_bitmask[NBITS(KEY_MAX)];
unsigned long rel_bitmask[NLONGS(REL_CNT)]; long rel_bitmask[NBITS(REL_MAX)];
unsigned long abs_bitmask[NLONGS(ABS_CNT)]; long abs_bitmask[NBITS(ABS_MAX)];
unsigned long led_bitmask[NLONGS(LED_CNT)]; long led_bitmask[NBITS(LED_MAX)];
struct input_absinfo absinfo[ABS_CNT]; struct input_absinfo absinfo[ABS_MAX];
/* minor/major number */
dev_t min_maj;
/* Event queue used to defer keyboard/button events until EV_SYN time. */
int num_queue;
EventQueueRec queue[EVDEV_MAXQUEUE];
} EvdevRec, *EvdevPtr; } EvdevRec, *EvdevPtr;
/* Event posting functions */
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, int value);
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
int v[MAX_VALUATORS]);
void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v,
int v[MAX_VALUATORS]);
unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code); unsigned int EvdevUtilButtonEventToButtonNumber(EvdevPtr pEvdev, int code);
/* Middle Button emulation */ /* Middle Button emulation */