mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
40 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
11d506dce6 | ||
|
|
a34a2cd347 | ||
|
|
78c00bd77f | ||
|
|
760f1c6bb1 | ||
|
|
2db04ba3c3 | ||
|
|
363d0bdb9f | ||
|
|
16a26a1eca | ||
|
|
b879ae7351 | ||
|
|
53566b7d4d | ||
|
|
29c2765fc3 | ||
|
|
7ef4e2c5e1 | ||
|
|
dd0eeacc24 | ||
|
|
67c0ea6c94 | ||
|
|
6bcbbc0411 | ||
|
|
534a3734d0 | ||
|
|
215c230d5c | ||
|
|
8f96530449 | ||
|
|
4fb97edcd4 | ||
|
|
4e86393bc0 | ||
|
|
a64a78791f | ||
|
|
09b2a5e87b | ||
|
|
fa18a4a38d | ||
|
|
172523d745 | ||
|
|
8fb820ffaf | ||
|
|
c7893b212d | ||
|
|
e9dd721e2d | ||
|
|
cab104fd9e | ||
|
|
708eb34599 | ||
|
|
36a687796f | ||
|
|
26229df106 | ||
|
|
f4616d87fc | ||
|
|
2aa5ca8cdd | ||
|
|
39263dc65d | ||
|
|
57521e4e60 | ||
|
|
7da1522309 | ||
|
|
b4fcb825fc | ||
|
|
7c955ad050 | ||
|
|
4f80c0f2cb | ||
|
|
5070d64aa8 | ||
|
|
caacacf057 |
19
.cvsignore
Normal file
19
.cvsignore
Normal 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
5
.gitignore
vendored
@@ -22,7 +22,6 @@ missing
|
|||||||
*.lo
|
*.lo
|
||||||
*.la
|
*.la
|
||||||
stamp-h1
|
stamp-h1
|
||||||
xf86-input-evdev-*.tar.*
|
*.bz2
|
||||||
|
*.gz
|
||||||
*.pc
|
*.pc
|
||||||
*~
|
|
||||||
tags
|
|
||||||
|
|||||||
@@ -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
20
README
@@ -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
|
|
||||||
29
configure.ac
29
configure.ac
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([xf86-input-evdev],
|
AC_INIT([xf86-input-evdev],
|
||||||
2.3.2,
|
2.1.1,
|
||||||
[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
|
||||||
|
|||||||
@@ -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
2
man/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
136
man/evdev.man
136
man/evdev.man
@@ -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,17 +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".
|
|
||||||
.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
|
||||||
@@ -96,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.
|
||||||
@@ -105,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
|
||||||
@@ -123,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
|
||||||
@@ -183,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
|
||||||
@@ -215,14 +174,29 @@ 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.
|
||||||
|
|||||||
6
src/.cvsignore
Normal file
6
src/.cvsignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.deps
|
||||||
|
.libs
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
*.la
|
||||||
|
*.lo
|
||||||
@@ -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@
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
14
src/emuMB.c
14
src/emuMB.c
@@ -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 {
|
||||||
@@ -248,12 +248,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 +327,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 +335,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 +352,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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|
||||||
|
|||||||
1892
src/evdev.c
1892
src/evdev.c
File diff suppressed because it is too large
Load Diff
78
src/evdev.h
78
src/evdev.h
@@ -25,7 +25,6 @@
|
|||||||
* 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
|
||||||
@@ -36,7 +35,10 @@
|
|||||||
|
|
||||||
#include <xf86Xinput.h>
|
#include <xf86Xinput.h>
|
||||||
#include <xf86_OSproc.h>
|
#include <xf86_OSproc.h>
|
||||||
|
|
||||||
|
#ifdef XKB
|
||||||
#include <xkbstr.h>
|
#include <xkbstr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */
|
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */
|
||||||
#define EV_CNT (EV_MAX+1)
|
#define EV_CNT (EV_MAX+1)
|
||||||
@@ -55,28 +57,11 @@
|
|||||||
#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)
|
||||||
|
|
||||||
/* Number of longs needed to hold the given number of bits */
|
/* Number of longs needed to hold the given number of bits */
|
||||||
@@ -89,41 +74,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 +138,17 @@ typedef struct {
|
|||||||
|
|
||||||
/* Cached info from device. */
|
/* Cached info from device. */
|
||||||
char name[1024];
|
char name[1024];
|
||||||
unsigned long bitmask[NLONGS(EV_CNT)];
|
long bitmask[NLONGS(EV_CNT)];
|
||||||
unsigned long key_bitmask[NLONGS(KEY_CNT)];
|
long key_bitmask[NLONGS(KEY_CNT)];
|
||||||
unsigned long rel_bitmask[NLONGS(REL_CNT)];
|
long rel_bitmask[NLONGS(REL_CNT)];
|
||||||
unsigned long abs_bitmask[NLONGS(ABS_CNT)];
|
long abs_bitmask[NLONGS(ABS_CNT)];
|
||||||
unsigned long led_bitmask[NLONGS(LED_CNT)];
|
long led_bitmask[NLONGS(LED_CNT)];
|
||||||
struct input_absinfo absinfo[ABS_CNT];
|
struct input_absinfo absinfo[ABS_CNT];
|
||||||
|
|
||||||
/* minor/major number */
|
/* minor/major number */
|
||||||
dev_t min_maj;
|
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 */
|
||||||
|
|||||||
Reference in New Issue
Block a user