mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
52 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f48abf89e4 | ||
|
|
87819fe86b | ||
|
|
ffa1fbc770 | ||
|
|
40bb3c69ce | ||
|
|
675218cbf5 | ||
|
|
ad834abd57 | ||
|
|
3549c3e5f0 | ||
|
|
5def56d2f4 | ||
|
|
b907c23d00 | ||
|
|
6c975917f8 | ||
|
|
ac421e536c | ||
|
|
bd55c2f021 | ||
|
|
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
|
||||||
77
.gitignore
vendored
77
.gitignore
vendored
@@ -1,78 +1,27 @@
|
|||||||
#
|
*.patch
|
||||||
# X.Org module default exclusion patterns
|
|
||||||
# The next section if for module specific patterns
|
|
||||||
#
|
|
||||||
# Do not edit the following section
|
|
||||||
# GNU Build System (Autotools)
|
|
||||||
aclocal.m4
|
|
||||||
autom4te.cache/
|
|
||||||
autoscan.log
|
|
||||||
ChangeLog
|
ChangeLog
|
||||||
compile
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
aclocal.m4
|
||||||
|
autom4te.cache
|
||||||
config.guess
|
config.guess
|
||||||
config.h
|
config.h
|
||||||
config.h.in
|
config.h.in
|
||||||
config.log
|
config.log
|
||||||
config-ml.in
|
|
||||||
config.py
|
|
||||||
config.status
|
config.status
|
||||||
config.status.lineno
|
|
||||||
config.sub
|
config.sub
|
||||||
configure
|
configure
|
||||||
configure.scan
|
|
||||||
depcomp
|
depcomp
|
||||||
.deps/
|
|
||||||
INSTALL
|
|
||||||
install-sh
|
install-sh
|
||||||
.libs/
|
|
||||||
libtool
|
libtool
|
||||||
libtool.m4
|
|
||||||
ltmain.sh
|
ltmain.sh
|
||||||
lt~obsolete.m4
|
man/evdev.4
|
||||||
ltoptions.m4
|
|
||||||
ltsugar.m4
|
|
||||||
ltversion.m4
|
|
||||||
Makefile
|
|
||||||
Makefile.in
|
|
||||||
mdate-sh
|
|
||||||
missing
|
missing
|
||||||
mkinstalldirs
|
.deps
|
||||||
|
.libs
|
||||||
|
*.lo
|
||||||
|
*.la
|
||||||
|
stamp-h1
|
||||||
|
*.bz2
|
||||||
|
*.gz
|
||||||
*.pc
|
*.pc
|
||||||
py-compile
|
|
||||||
stamp-h?
|
|
||||||
symlink-tree
|
|
||||||
texinfo.tex
|
|
||||||
ylwrap
|
|
||||||
|
|
||||||
# Do not edit the following section
|
|
||||||
# Edit Compile Debug Document Distribute
|
|
||||||
*~
|
|
||||||
*.[0-9]
|
|
||||||
*.[0-9]x
|
|
||||||
*.bak
|
|
||||||
*.bin
|
|
||||||
core
|
|
||||||
*.dll
|
|
||||||
*.exe
|
|
||||||
*-ISO*.bdf
|
|
||||||
*-JIS*.bdf
|
|
||||||
*-KOI8*.bdf
|
|
||||||
*.kld
|
|
||||||
*.ko
|
|
||||||
*.ko.cmd
|
|
||||||
*.lai
|
|
||||||
*.l[oa]
|
|
||||||
*.[oa]
|
|
||||||
*.obj
|
|
||||||
*.patch
|
|
||||||
*.so
|
|
||||||
*.pcf.gz
|
|
||||||
*.pdb
|
|
||||||
*.tar.bz2
|
|
||||||
*.tar.gz
|
|
||||||
#
|
|
||||||
# Add & Override patterns for xf86-input-evdev
|
|
||||||
#
|
|
||||||
# Edit the following section as needed
|
|
||||||
# For example, !report.pc overrides *.pc. See 'man gitignore'
|
|
||||||
#
|
|
||||||
|
|||||||
35
COPYING
35
COPYING
@@ -23,24 +23,27 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||||||
|
|
||||||
Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a
|
Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
copy of this software and associated documentation files (the "Software"),
|
documentation for any purpose is hereby granted without fee, provided that
|
||||||
to deal in the Software without restriction, including without limitation
|
the above copyright notice appear in all copies and that both that
|
||||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
copyright notice and this permission notice appear in supporting
|
||||||
and/or sell copies of the Software, and to permit persons to whom the
|
documentation.
|
||||||
Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice (including the next
|
The above copyright notice and this permission notice shall be included
|
||||||
paragraph) shall be included in all copies or substantial portions of the
|
in all copies or substantial portions of the Software.
|
||||||
Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
DEALINGS IN THE SOFTWARE.
|
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.
|
||||||
|
|
||||||
Copyright © 2008 University of South Australia
|
Copyright © 2008 University of South Australia
|
||||||
copyrights taken from xf86-input-mouse, partly valid for this driver.
|
copyrights taken from xf86-input-mouse, partly valid for this driver.
|
||||||
|
|||||||
17
Makefile.am
17
Makefile.am
@@ -18,23 +18,20 @@
|
|||||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
# 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.
|
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
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
|
||||||
MAINTAINERCLEANFILES = ChangeLog INSTALL
|
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = xorg-evdev.pc
|
pkgconfig_DATA = xorg-evdev.pc
|
||||||
|
|
||||||
|
EXTRA_DIST = ChangeLog autogen.sh
|
||||||
|
|
||||||
.PHONY: ChangeLog INSTALL
|
MAINTAINERCLEANFILES=ChangeLog
|
||||||
|
|
||||||
INSTALL:
|
.PHONY: ChangeLog
|
||||||
$(INSTALL_CMD)
|
|
||||||
|
|
||||||
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 INSTALL
|
dist-hook: ChangeLog
|
||||||
|
|||||||
26
configure.ac
26
configure.ac
@@ -22,21 +22,18 @@
|
|||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([xf86-input-evdev],
|
AC_INIT([xf86-input-evdev],
|
||||||
2.4.0,
|
2.1.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)
|
||||||
|
|
||||||
AC_CONFIG_SRCDIR([Makefile.am])
|
AC_CONFIG_SRCDIR([Makefile.am])
|
||||||
AC_CONFIG_AUX_DIR(.)
|
AC_CONFIG_AUX_DIR(.)
|
||||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
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_SUBST([DRIVER_NAME])
|
||||||
[m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
|
||||||
XORG_MACROS_VERSION(1.3)
|
|
||||||
XORG_DEFAULT_OPTIONS
|
|
||||||
|
|
||||||
AM_CONFIG_HEADER([config.h])
|
AM_CONFIG_HEADER([config.h])
|
||||||
|
|
||||||
@@ -58,22 +55,21 @@ AC_SUBST(inputdir)
|
|||||||
# Checks for extensions
|
# Checks for extensions
|
||||||
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
|
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
|
||||||
|
|
||||||
# Checks for pkg-config packages. We need to be able to override sdkdir
|
# Checks for pkg-config packages
|
||||||
# to satisfy silly distcheck requirements.
|
|
||||||
PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
|
PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
|
||||||
|
sdkdir=$(pkg-config --variable=sdkdir xorg-server)
|
||||||
|
AC_SUBST(sdkdir)
|
||||||
|
|
||||||
AC_ARG_WITH([sdkdir], [],
|
CFLAGS="$CFLAGS $XORG_CFLAGS "' -I$(top_srcdir)/src'
|
||||||
[sdkdir="$withval"],
|
AC_SUBST([CFLAGS])
|
||||||
[sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`])
|
|
||||||
AC_SUBST([sdkdir])
|
|
||||||
|
|
||||||
# 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 */
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
/* Reopen attempts. */
|
/* Reopen attempts. */
|
||||||
/* CARD8 */
|
/* CARD8 */
|
||||||
#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts" /* OBSOLETE */
|
#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts"
|
||||||
|
|
||||||
/* Run-time calibration */
|
/* Run-time calibration */
|
||||||
/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */
|
/* CARD32, 4 values [minx, maxx, miny, maxy], or no values for unset */
|
||||||
|
|||||||
2
man/.cvsignore
Normal file
2
man/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
@@ -1,23 +1,26 @@
|
|||||||
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||||
# copy of this software and associated documentation files (the "Software"),
|
# documentation for any purpose is hereby granted without fee, provided that
|
||||||
# to deal in the Software without restriction, including without limitation
|
# the above copyright notice appear in all copies and that both that
|
||||||
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
# copyright notice and this permission notice appear in supporting
|
||||||
# and/or sell copies of the Software, and to permit persons to whom the
|
# documentation.
|
||||||
# Software is furnished to do so, subject to the following conditions:
|
#
|
||||||
#
|
# The above copyright notice and this permission notice shall be included
|
||||||
# The above copyright notice and this permission notice (including the next
|
# in all copies or substantial portions of the Software.
|
||||||
# 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
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
# OTHER DEALINGS IN THE SOFTWARE.
|
||||||
# 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)
|
drivermandir = $(DRIVER_MAN_DIR)
|
||||||
|
|||||||
140
man/evdev.man
140
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,19 +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: off for touchscreens, otherwise
|
|
||||||
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
|
||||||
@@ -98,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.
|
||||||
@@ -107,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
|
||||||
@@ -125,50 +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 \*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
|
|
||||||
.B Option \*qMode\*q \*qRelative\*q\fP|\fP\*qAbsolute\*q
|
|
||||||
Sets the mode of the device if device has absolute axes.
|
|
||||||
The default value for touchpads is relative, for other absolute.
|
|
||||||
This option has no effect on devices without absolute axes.
|
|
||||||
.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
|
||||||
@@ -186,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
|
||||||
@@ -218,14 +174,30 @@ 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.
|
||||||
|
.TP 7
|
||||||
|
.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 value (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,9 +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) $(CWARNFLAGS)
|
|
||||||
|
|
||||||
@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)
|
||||||
{
|
{
|
||||||
@@ -256,7 +256,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 +269,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;
|
||||||
|
|||||||
20
src/emuMB.c
20
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,11 +309,7 @@ void
|
|||||||
EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
EvdevMBEmuPreInit(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
|
pEvdev->emulateMB.enabled = MBEMU_AUTO;
|
||||||
if (pEvdev->flags & EVDEV_TOUCHSCREEN)
|
|
||||||
pEvdev->emulateMB.enabled = MBEMU_DISABLED;
|
|
||||||
else
|
|
||||||
pEvdev->emulateMB.enabled = MBEMU_AUTO;
|
|
||||||
|
|
||||||
if (xf86FindOption(pInfo->options, "Emulate3Buttons"))
|
if (xf86FindOption(pInfo->options, "Emulate3Buttons"))
|
||||||
{
|
{
|
||||||
@@ -331,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);
|
||||||
@@ -342,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);
|
||||||
@@ -362,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,61 +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 oldValue;
|
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 */
|
||||||
if(pEv->type == EV_ABS) {
|
|
||||||
oldValue = pEvdev->vals[pEvdev->axis_map[pEv->code]];
|
|
||||||
pEvdev->vals[pEvdev->axis_map[pEv->code]] = value;
|
|
||||||
value -= oldValue; /* make value into a differential measurement */
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(pEv->code) {
|
switch(pEv->code) {
|
||||||
|
|
||||||
/* ABS_X has the same value as REL_X, so this case catches both */
|
|
||||||
case REL_X:
|
case REL_X:
|
||||||
pAxis = &(pEvdev->emulateWheel.X);
|
pAxis = &(pEvdev->emulateWheel.X);
|
||||||
pOtherAxis = &(pEvdev->emulateWheel.Y);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* ABS_Y has the same value as REL_Y, so this case catches both */
|
|
||||||
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, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
/* If we found REL_X or REL_Y, emulate a mouse wheel */
|
||||||
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;
|
||||||
@@ -161,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;
|
||||||
|
|
||||||
@@ -188,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,
|
||||||
@@ -226,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",
|
||||||
@@ -310,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",
|
||||||
@@ -336,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)
|
||||||
{
|
{
|
||||||
@@ -362,6 +337,15 @@ 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)
|
||||||
|
|||||||
1948
src/evdev.c
1948
src/evdev.c
File diff suppressed because it is too large
Load Diff
96
src/evdev.h
96
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,9 +35,12 @@
|
|||||||
|
|
||||||
#include <xf86Xinput.h>
|
#include <xf86Xinput.h>
|
||||||
#include <xf86_OSproc.h>
|
#include <xf86_OSproc.h>
|
||||||
#include <xkbstr.h>
|
|
||||||
|
|
||||||
#ifndef EV_CNT /* linux 2.6.23 kernels and earlier lack _CNT defines */
|
#ifdef XKB
|
||||||
|
#include <xkbstr.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */
|
||||||
#define EV_CNT (EV_MAX+1)
|
#define EV_CNT (EV_MAX+1)
|
||||||
#endif
|
#endif
|
||||||
#ifndef KEY_CNT
|
#ifndef KEY_CNT
|
||||||
@@ -55,42 +57,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EVDEV_MAXBUTTONS 32
|
#define EVDEV_MAXBUTTONS 32
|
||||||
#define EVDEV_MAXQUEUE 32
|
|
||||||
|
|
||||||
/* evdev flags */
|
|
||||||
#define EVDEV_KEYBOARD_EVENTS (1 << 0)
|
|
||||||
#define EVDEV_BUTTON_EVENTS (1 << 1)
|
|
||||||
#define EVDEV_RELATIVE_EVENTS (1 << 2)
|
|
||||||
#define EVDEV_ABSOLUTE_EVENTS (1 << 3)
|
|
||||||
#define EVDEV_TOUCHPAD (1 << 4)
|
|
||||||
#define EVDEV_INITIALIZED (1 << 5) /* WheelInit etc. called already? */
|
|
||||||
#define EVDEV_TOUCHSCREEN (1 << 6)
|
|
||||||
#define EVDEV_CALIBRATED (1 << 7) /* run-time calibrated? */
|
|
||||||
#define EVDEV_TABLET (1 << 8) /* device looks like a tablet? */
|
|
||||||
#define EVDEV_UNIGNORE_ABSOLUTE (1 << 9) /* explicitly unignore abs axes */
|
|
||||||
#define EVDEV_UNIGNORE_RELATIVE (1 << 10) /* explicitly unignore rel axes */
|
|
||||||
#define EVDEV_RELATIVE_MODE (1 << 11) /* Force relative events for devices with absolute axes */
|
|
||||||
|
|
||||||
#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 */
|
||||||
@@ -103,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;
|
||||||
@@ -179,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