mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
31 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1936632cb0 | ||
|
|
0dc931e1ac | ||
|
|
d525b48a2f | ||
|
|
801778c310 | ||
|
|
99505011d1 | ||
|
|
fd036680c2 | ||
|
|
e81cd935cf | ||
|
|
0b5844ce67 | ||
|
|
d6beb16be2 | ||
|
|
2f5a0fb698 | ||
|
|
1b0df04abe | ||
|
|
2ca24a16f0 | ||
|
|
7b285a802b | ||
|
|
f187badb71 | ||
|
|
0e9d75ba68 | ||
|
|
3a6d27b83d | ||
|
|
886e303af1 | ||
|
|
3d23ef4888 | ||
|
|
c0473e4921 | ||
|
|
afc9e91765 | ||
|
|
c1f16a4f59 | ||
|
|
a0f7f34dc5 | ||
|
|
11669d8279 | ||
|
|
9cbffda910 | ||
|
|
59056e656c | ||
|
|
aa6399fdb9 | ||
|
|
1d86f5dec1 | ||
|
|
fbd86e2530 | ||
|
|
9ea1f9a695 | ||
|
|
57b54ee399 | ||
|
|
f2dc0681fe |
76
.gitignore
vendored
76
.gitignore
vendored
@@ -1,28 +1,78 @@
|
|||||||
*.patch
|
#
|
||||||
ChangeLog
|
# X.Org module default exclusion patterns
|
||||||
Makefile
|
# The next section if for module specific patterns
|
||||||
Makefile.in
|
#
|
||||||
|
# Do not edit the following section
|
||||||
|
# GNU Build System (Autotools)
|
||||||
aclocal.m4
|
aclocal.m4
|
||||||
autom4te.cache
|
autom4te.cache/
|
||||||
|
autoscan.log
|
||||||
|
ChangeLog
|
||||||
|
compile
|
||||||
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
|
||||||
man/evdev.4
|
lt~obsolete.m4
|
||||||
|
ltoptions.m4
|
||||||
|
ltsugar.m4
|
||||||
|
ltversion.m4
|
||||||
|
Makefile
|
||||||
|
Makefile.in
|
||||||
|
mdate-sh
|
||||||
missing
|
missing
|
||||||
.deps
|
mkinstalldirs
|
||||||
.libs
|
|
||||||
*.lo
|
|
||||||
*.la
|
|
||||||
stamp-h1
|
|
||||||
xf86-input-evdev-*.tar.*
|
|
||||||
*.pc
|
*.pc
|
||||||
|
py-compile
|
||||||
|
stamp-h?
|
||||||
|
symlink-tree
|
||||||
|
texinfo.tex
|
||||||
|
ylwrap
|
||||||
|
|
||||||
|
# Do not edit the following section
|
||||||
|
# Edit Compile Debug Document Distribute
|
||||||
*~
|
*~
|
||||||
tags
|
*.[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,27 +23,24 @@ 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 to use, copy, modify, distribute, and sell this software and its
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
documentation for any purpose is hereby granted without fee, provided that
|
copy of this software and associated documentation files (the "Software"),
|
||||||
the above copyright notice appear in all copies and that both that
|
to deal in the Software without restriction, including without limitation
|
||||||
copyright notice and this permission notice appear in supporting
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
documentation.
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice 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
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
OTHER DEALINGS IN THE SOFTWARE.
|
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.
|
||||||
|
|||||||
10
Makefile.am
10
Makefile.am
@@ -18,23 +18,23 @@
|
|||||||
# 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
|
# Ensure headers are installed below $(prefix) for distcheck
|
||||||
DISTCHECK_CONFIGURE_FLAGS = --with-sdkdir='$${includedir}/xorg'
|
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
|
|
||||||
|
|
||||||
MAINTAINERCLEANFILES=ChangeLog
|
.PHONY: ChangeLog INSTALL
|
||||||
|
|
||||||
.PHONY: ChangeLog
|
INSTALL:
|
||||||
|
$(INSTALL_CMD)
|
||||||
|
|
||||||
ChangeLog:
|
ChangeLog:
|
||||||
$(CHANGELOG_CMD)
|
$(CHANGELOG_CMD)
|
||||||
|
|
||||||
dist-hook: ChangeLog
|
dist-hook: ChangeLog INSTALL
|
||||||
|
|||||||
15
configure.ac
15
configure.ac
@@ -22,26 +22,28 @@
|
|||||||
|
|
||||||
AC_PREREQ(2.57)
|
AC_PREREQ(2.57)
|
||||||
AC_INIT([xf86-input-evdev],
|
AC_INIT([xf86-input-evdev],
|
||||||
2.2.99.2,
|
2.4.0,
|
||||||
[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([dist-bzip2])
|
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||||
|
|
||||||
AM_MAINTAINER_MODE
|
AM_MAINTAINER_MODE
|
||||||
|
|
||||||
# Require xorg-macros: XORG_DEFAULT_OPTIONS
|
# Require xorg-macros: XORG_DEFAULT_OPTIONS
|
||||||
m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
m4_ifndef([XORG_MACROS_VERSION],
|
||||||
|
[m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
||||||
XORG_MACROS_VERSION(1.3)
|
XORG_MACROS_VERSION(1.3)
|
||||||
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
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,10 +55,13 @@ AC_ARG_WITH(xorg-module-dir,
|
|||||||
inputdir=${moduledir}/input
|
inputdir=${moduledir}/input
|
||||||
AC_SUBST(inputdir)
|
AC_SUBST(inputdir)
|
||||||
|
|
||||||
|
# Checks for extensions
|
||||||
|
XORG_DRIVER_CHECK_EXT(XINPUT, inputproto)
|
||||||
|
|
||||||
# Checks for pkg-config packages. We need to be able to override sdkdir
|
# Checks for pkg-config packages. We need to be able to override sdkdir
|
||||||
# to satisfy silly distcheck requirements.
|
# to satisfy silly distcheck requirements.
|
||||||
PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
|
PKG_CHECK_MODULES(XORG, xorg-server xproto $REQUIRED_MODULES)
|
||||||
XORG_CFLAGS="$CWARNFLAGS $XORG_CFLAGS"
|
|
||||||
AC_ARG_WITH([sdkdir], [],
|
AC_ARG_WITH([sdkdir], [],
|
||||||
[sdkdir="$withval"],
|
[sdkdir="$withval"],
|
||||||
[sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`])
|
[sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`])
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
/* Reopen attempts. */
|
/* Reopen attempts. */
|
||||||
/* CARD8 */
|
/* CARD8 */
|
||||||
#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts"
|
#define EVDEV_PROP_REOPEN "Evdev Reopen Attempts" /* OBSOLETE */
|
||||||
|
|
||||||
/* 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 */
|
||||||
|
|||||||
@@ -1,26 +1,23 @@
|
|||||||
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
# documentation for any purpose is hereby granted without fee, provided that
|
# copy of this software and associated documentation files (the "Software"),
|
||||||
# the above copyright notice appear in all copies and that both that
|
# to deal in the Software without restriction, including without limitation
|
||||||
# copyright notice and this permission notice appear in supporting
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
# documentation.
|
# and/or sell copies of the Software, and to permit persons to whom the
|
||||||
#
|
# Software is furnished to do so, subject to the following conditions:
|
||||||
# The above copyright notice and this permission notice shall be included
|
#
|
||||||
# in all copies or substantial portions of the Software.
|
# The above copyright notice and this permission notice (including the next
|
||||||
#
|
# paragraph) shall be included in all copies or substantial portions of the
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
# Software.
|
||||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
#
|
||||||
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
# IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||||
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
# OTHER DEALINGS IN THE SOFTWARE.
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
#
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
# Except as contained in this notice, the name of the copyright holders shall
|
# DEALINGS IN THE SOFTWARE.
|
||||||
# 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)
|
||||||
|
|||||||
@@ -76,13 +76,15 @@ indicating that the next button pressed is to be
|
|||||||
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
|
.BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q
|
||||||
Enable/disable the emulation of the third (middle) mouse button for mice
|
Enable/disable the emulation of the third (middle) mouse button for mice
|
||||||
which only have two physical buttons. The third button is emulated by
|
which only have two physical buttons. The third button is emulated by
|
||||||
pressing both buttons simultaneously. Default: on, until a middle mouse
|
pressing both buttons simultaneously. Default: off for touchscreens, otherwise
|
||||||
button event is registered. Property: "Evdev Middle Button Emulation".
|
on until a middle mouse button event is registered. Property: "Evdev Middle
|
||||||
|
Button Emulation".
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
|
.BI "Option \*qEmulate3Timeout\*q \*q" integer \*q
|
||||||
Sets the timeout (in milliseconds) that the driver waits before deciding
|
Sets the timeout (in milliseconds) that the driver waits before deciding
|
||||||
if two buttons where pressed "simultaneously" when 3 button emulation is
|
if two buttons where pressed "simultaneously" when 3 button emulation is
|
||||||
enabled. Default: 50. Property: "Evdev Middle Button Timeout".
|
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
|
||||||
@@ -138,17 +140,31 @@ Invert the given axis. Default: off. Property: "Evdev Axis Inversion".
|
|||||||
.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
|
.BI "Option \*qIgnoreRelativeAxes\*q \*q" Bool \*q
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
|
.BI "Option \*qIgnoreAbsoluteAxes\*q \*q" Bool \*q
|
||||||
Ignore the specified type of axis. Default: off. The X server cannot deal
|
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
|
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
|
wich axes to ignore given the device type and disables absolute axes for
|
||||||
mice and relative axes for tablets, touchscreens and touchpad. These options
|
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
|
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
|
work even if relative axes are ignored. No property, this configuration must
|
||||||
be set in the configuration.
|
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
|
.TP 7
|
||||||
.BI "Option \*qReopenAttempts\*q \*q" integer \*q
|
.BI "Option \*qCalibration\*q \*q" "min-x max-x min-y max-y" \*q
|
||||||
Number of reopen attempts after a read error occurs on the device (e.g. after
|
Calibrates the X and Y axes for devices that need to scale to a different
|
||||||
waking up from suspend). In between each attempt is a 100ms wait. Default: 10.
|
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
|
.TP 7
|
||||||
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
|
.BI "Option \*qSwapAxes\*q \*q" Bool \*q
|
||||||
Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
|
Swap x/y axes. Default: off. Property: "Evdev Axes Swap".
|
||||||
@@ -178,9 +194,7 @@ driver.
|
|||||||
.TP 7
|
.TP 7
|
||||||
.BI "Evdev Axis Calibration"
|
.BI "Evdev Axis Calibration"
|
||||||
4 32-bit values, order min-x, max-x, min-y, max-y or 0 values to disable
|
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
|
in-driver axis calibration.
|
||||||
scale to a different coordinate system than originally reported to the X
|
|
||||||
server, such as touchscreens that require run-time calibration.
|
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Evdev Axis Inversion"
|
.BI "Evdev Axis Inversion"
|
||||||
2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
|
2 boolean values (8 bit, 0 or 1), order X, Y. 1 inverts the axis.
|
||||||
|
|||||||
@@ -24,7 +24,8 @@
|
|||||||
# -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)
|
|
||||||
|
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
|
||||||
|
|||||||
@@ -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
|
} else if ((val->size % 2) == 0)
|
||||||
{
|
{
|
||||||
CARD8* vals = (CARD8*)val->data;
|
CARD8* vals = (CARD8*)val->data;
|
||||||
|
|
||||||
@@ -269,10 +269,11 @@ 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++)
|
for (i = 0; i < val->size && i < EVDEV_MAXBUTTONS; i += 2)
|
||||||
pEvdev->dragLock.lock_pair[i] = vals[i];
|
pEvdev->dragLock.lock_pair[vals[i] - 1] = vals[i + 1];
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
return BadMatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|||||||
@@ -309,7 +309,11 @@ 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"))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -100,6 +100,7 @@ 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, pOtherAxis = NULL;
|
||||||
int value = pEv->value;
|
int value = pEv->value;
|
||||||
|
int oldValue;
|
||||||
|
|
||||||
/* Has wheel emulation been configured to be enabled? */
|
/* Has wheel emulation been configured to be enabled? */
|
||||||
if (!pEvdev->emulateWheel.enabled)
|
if (!pEvdev->emulateWheel.enabled)
|
||||||
@@ -118,12 +119,21 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 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);
|
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);
|
pOtherAxis = &(pEvdev->emulateWheel.X);
|
||||||
@@ -133,11 +143,11 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we found REL_X or REL_Y, emulate a mouse wheel.
|
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
||||||
Reset the inertia of the other axis when a scroll event was sent
|
wheel. Reset the inertia of the other axis when a scroll event
|
||||||
to avoid the buildup of erroneous scroll events if the user
|
was sent to avoid the buildup of erroneous scroll events if the
|
||||||
doesn't move in a perfectly straight line.
|
user doesn't move in a perfectly straight line.
|
||||||
*/
|
*/
|
||||||
if (pAxis)
|
if (pAxis)
|
||||||
{
|
{
|
||||||
if (EvdevWheelEmuInertia(pInfo, pAxis, value))
|
if (EvdevWheelEmuInertia(pInfo, pAxis, value))
|
||||||
|
|||||||
528
src/evdev.c
528
src/evdev.c
@@ -32,6 +32,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
#include <X11/extensions/XI.h>
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -80,17 +81,6 @@
|
|||||||
|
|
||||||
#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
|
#define ArrayLength(a) (sizeof(a) / (sizeof((a)[0])))
|
||||||
|
|
||||||
/* 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) /* run-time calibrated? */
|
|
||||||
|
|
||||||
#define MIN_KEYCODE 8
|
#define MIN_KEYCODE 8
|
||||||
#define GLYPHS_PER_KEY 2
|
#define GLYPHS_PER_KEY 2
|
||||||
#define AltMask Mod1Mask
|
#define AltMask Mod1Mask
|
||||||
@@ -115,6 +105,7 @@ static const char *evdevDefaults[] = {
|
|||||||
static int EvdevOn(DeviceIntPtr);
|
static int EvdevOn(DeviceIntPtr);
|
||||||
static int EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare);
|
static int EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare);
|
||||||
static void EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
|
static void EvdevKbdCtrl(DeviceIntPtr device, KeybdCtrl *ctrl);
|
||||||
|
static int EvdevSwitchMode(ClientPtr client, DeviceIntPtr device, int mode);
|
||||||
|
|
||||||
#ifdef HAVE_PROPERTIES
|
#ifdef HAVE_PROPERTIES
|
||||||
static void EvdevInitAxesLabels(EvdevPtr pEvdev, int natoms, Atom *atoms);
|
static void EvdevInitAxesLabels(EvdevPtr pEvdev, int natoms, Atom *atoms);
|
||||||
@@ -123,7 +114,6 @@ static void EvdevInitProperty(DeviceIntPtr dev);
|
|||||||
static int EvdevSetProperty(DeviceIntPtr dev, Atom atom,
|
static int EvdevSetProperty(DeviceIntPtr dev, Atom atom,
|
||||||
XIPropertyValuePtr val, BOOL checkonly);
|
XIPropertyValuePtr val, BOOL checkonly);
|
||||||
static Atom prop_invert = 0;
|
static Atom prop_invert = 0;
|
||||||
static Atom prop_reopen = 0;
|
|
||||||
static Atom prop_calibration = 0;
|
static Atom prop_calibration = 0;
|
||||||
static Atom prop_swap = 0;
|
static Atom prop_swap = 0;
|
||||||
static Atom prop_axis_label = 0;
|
static Atom prop_axis_label = 0;
|
||||||
@@ -135,6 +125,38 @@ static Atom prop_btn_label = 0;
|
|||||||
* cannot be used by evdev, leaving us with a space of 2 at the end. */
|
* cannot be used by evdev, leaving us with a space of 2 at the end. */
|
||||||
static EvdevPtr evdev_devices[MAXDEVICES] = {NULL};
|
static EvdevPtr evdev_devices[MAXDEVICES] = {NULL};
|
||||||
|
|
||||||
|
static int EvdevSwitchMode(ClientPtr client, DeviceIntPtr device, int mode)
|
||||||
|
{
|
||||||
|
InputInfoPtr pInfo;
|
||||||
|
EvdevPtr pEvdev;
|
||||||
|
|
||||||
|
pInfo = device->public.devicePrivate;
|
||||||
|
pEvdev = pInfo->private;
|
||||||
|
|
||||||
|
if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
|
||||||
|
{
|
||||||
|
if (mode == Relative)
|
||||||
|
return Success;
|
||||||
|
else
|
||||||
|
return XI_BadMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case Absolute:
|
||||||
|
pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Relative:
|
||||||
|
pEvdev->flags |= EVDEV_RELATIVE_MODE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
return XI_BadMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Success;
|
||||||
|
}
|
||||||
|
|
||||||
static size_t CountBits(unsigned long *array, size_t nlongs)
|
static size_t CountBits(unsigned long *array, size_t nlongs)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -254,7 +276,6 @@ void
|
|||||||
EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||||
{
|
{
|
||||||
int code = ev->code + MIN_KEYCODE;
|
int code = ev->code + MIN_KEYCODE;
|
||||||
static char warned[KEY_CNT];
|
|
||||||
EventQueuePtr pQueue;
|
EventQueuePtr pQueue;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
@@ -272,19 +293,6 @@ EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
|||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (code > 255)
|
|
||||||
{
|
|
||||||
if (ev->code <= KEY_MAX && !warned[ev->code])
|
|
||||||
{
|
|
||||||
xf86Msg(X_WARNING, "%s: unable to handle keycode %d\n",
|
|
||||||
pInfo->name, ev->code);
|
|
||||||
warned[ev->code] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* The X server can't handle keycodes > 255. */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pEvdev->num_queue >= EVDEV_MAXQUEUE)
|
if (pEvdev->num_queue >= EVDEV_MAXQUEUE)
|
||||||
{
|
{
|
||||||
xf86Msg(X_NONE, "%s: dropping event due to full queue!\n", pInfo->name);
|
xf86Msg(X_NONE, "%s: dropping event due to full queue!\n", pInfo->name);
|
||||||
@@ -338,56 +346,6 @@ EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Coming back from resume may leave us with a file descriptor that can be
|
|
||||||
* opened but fails on the first read (ENODEV).
|
|
||||||
* In this case, try to open the device until it becomes available or until
|
|
||||||
* the predefined count expires.
|
|
||||||
*/
|
|
||||||
static CARD32
|
|
||||||
EvdevReopenTimer(OsTimerPtr timer, CARD32 time, pointer arg)
|
|
||||||
{
|
|
||||||
InputInfoPtr pInfo = (InputInfoPtr)arg;
|
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
|
||||||
|
|
||||||
do {
|
|
||||||
pInfo->fd = open(pEvdev->device, O_RDWR | O_NONBLOCK, 0);
|
|
||||||
} while (pInfo->fd < 0 && errno == EINTR);
|
|
||||||
|
|
||||||
if (pInfo->fd != -1)
|
|
||||||
{
|
|
||||||
if (EvdevCacheCompare(pInfo, TRUE) == Success)
|
|
||||||
{
|
|
||||||
xf86Msg(X_INFO, "%s: Device reopened after %d attempts.\n", pInfo->name,
|
|
||||||
pEvdev->reopen_attempts - pEvdev->reopen_left + 1);
|
|
||||||
EvdevOn(pInfo->dev);
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
xf86Msg(X_ERROR, "%s: Device has changed - disabling.\n",
|
|
||||||
pInfo->name);
|
|
||||||
xf86DisableDevice(pInfo->dev, FALSE);
|
|
||||||
close(pInfo->fd);
|
|
||||||
pInfo->fd = -1;
|
|
||||||
pEvdev->min_maj = 0; /* don't hog the device */
|
|
||||||
}
|
|
||||||
pEvdev->reopen_left = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
pEvdev->reopen_left--;
|
|
||||||
|
|
||||||
if (!pEvdev->reopen_left)
|
|
||||||
{
|
|
||||||
xf86Msg(X_ERROR, "%s: Failed to reopen device after %d attempts.\n",
|
|
||||||
pInfo->name, pEvdev->reopen_attempts);
|
|
||||||
xf86DisableDevice(pInfo->dev, FALSE);
|
|
||||||
pEvdev->min_maj = 0; /* don't hog the device */
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 100; /* come back in 100 ms */
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ABS_X_VALUE 0x1
|
#define ABS_X_VALUE 0x1
|
||||||
#define ABS_Y_VALUE 0x2
|
#define ABS_Y_VALUE 0x2
|
||||||
#define ABS_VALUE 0x4
|
#define ABS_VALUE 0x4
|
||||||
@@ -404,7 +362,7 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
|||||||
*num_v = *first_v = 0;
|
*num_v = *first_v = 0;
|
||||||
|
|
||||||
/* convert to relative motion for touchpads */
|
/* convert to relative motion for touchpads */
|
||||||
if (pEvdev->abs && (pEvdev->flags & EVDEV_TOUCHPAD)) {
|
if (pEvdev->abs && (pEvdev->flags & EVDEV_RELATIVE_MODE)) {
|
||||||
if (pEvdev->tool) { /* meaning, touch is active */
|
if (pEvdev->tool) { /* meaning, touch is active */
|
||||||
if (pEvdev->old_vals[0] != -1)
|
if (pEvdev->old_vals[0] != -1)
|
||||||
pEvdev->delta[REL_X] = pEvdev->vals[0] - pEvdev->old_vals[0];
|
pEvdev->delta[REL_X] = pEvdev->vals[0] - pEvdev->old_vals[0];
|
||||||
@@ -438,7 +396,7 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
|||||||
for (i = 0; i < REL_CNT; i++)
|
for (i = 0; i < REL_CNT; i++)
|
||||||
{
|
{
|
||||||
int map = pEvdev->axis_map[i];
|
int map = pEvdev->axis_map[i];
|
||||||
if (pEvdev->delta[i] && map != -1)
|
if (map != -1)
|
||||||
{
|
{
|
||||||
v[map] = pEvdev->delta[i];
|
v[map] = pEvdev->delta[i];
|
||||||
if (map < first)
|
if (map < first)
|
||||||
@@ -462,6 +420,13 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
|||||||
*/
|
*/
|
||||||
else if (pEvdev->abs && pEvdev->tool) {
|
else if (pEvdev->abs && pEvdev->tool) {
|
||||||
memcpy(v, pEvdev->vals, sizeof(int) * pEvdev->num_vals);
|
memcpy(v, pEvdev->vals, sizeof(int) * pEvdev->num_vals);
|
||||||
|
|
||||||
|
if (pEvdev->swap_axes) {
|
||||||
|
int tmp = v[0];
|
||||||
|
v[0] = v[1];
|
||||||
|
v[1] = tmp;
|
||||||
|
}
|
||||||
|
|
||||||
if (pEvdev->flags & EVDEV_CALIBRATED)
|
if (pEvdev->flags & EVDEV_CALIBRATED)
|
||||||
{
|
{
|
||||||
v[0] = xf86ScaleAxis(v[0],
|
v[0] = xf86ScaleAxis(v[0],
|
||||||
@@ -474,12 +439,6 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
|||||||
pEvdev->calibration.max_y, pEvdev->calibration.min_y);
|
pEvdev->calibration.max_y, pEvdev->calibration.min_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pEvdev->swap_axes) {
|
|
||||||
int tmp = v[0];
|
|
||||||
v[0] = v[1];
|
|
||||||
v[1] = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pEvdev->invert_x)
|
if (pEvdev->invert_x)
|
||||||
v[0] = (pEvdev->absinfo[ABS_X].maximum - v[0] +
|
v[0] = (pEvdev->absinfo[ABS_X].maximum - v[0] +
|
||||||
pEvdev->absinfo[ABS_X].minimum);
|
pEvdev->absinfo[ABS_X].minimum);
|
||||||
@@ -529,7 +488,7 @@ EvdevProcessButtonEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
static void
|
static void
|
||||||
EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||||
{
|
{
|
||||||
static int value;
|
int value;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
/* Get the signed value, earlier kernels had this as unsigned */
|
/* Get the signed value, earlier kernels had this as unsigned */
|
||||||
@@ -574,7 +533,7 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
static void
|
static void
|
||||||
EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||||
{
|
{
|
||||||
static int value;
|
int value;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
/* Get the signed value, earlier kernels had this as unsigned */
|
/* Get the signed value, earlier kernels had this as unsigned */
|
||||||
@@ -587,6 +546,9 @@ EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
if (ev->code > ABS_MAX)
|
if (ev->code > ABS_MAX)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (EvdevWheelEmuFilterMotion(pInfo, ev))
|
||||||
|
return;
|
||||||
|
|
||||||
pEvdev->vals[pEvdev->axis_map[ev->code]] = value;
|
pEvdev->vals[pEvdev->axis_map[ev->code]] = value;
|
||||||
if (ev->code == ABS_X)
|
if (ev->code == ABS_X)
|
||||||
pEvdev->abs |= ABS_X_VALUE;
|
pEvdev->abs |= ABS_X_VALUE;
|
||||||
@@ -602,7 +564,7 @@ EvdevProcessAbsoluteMotionEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
static void
|
static void
|
||||||
EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||||
{
|
{
|
||||||
static int value;
|
int value;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
/* Get the signed value, earlier kernels had this as unsigned */
|
/* Get the signed value, earlier kernels had this as unsigned */
|
||||||
@@ -614,7 +576,6 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
switch (ev->code) {
|
switch (ev->code) {
|
||||||
case BTN_TOUCH:
|
|
||||||
case BTN_TOOL_PEN:
|
case BTN_TOOL_PEN:
|
||||||
case BTN_TOOL_RUBBER:
|
case BTN_TOOL_RUBBER:
|
||||||
case BTN_TOOL_BRUSH:
|
case BTN_TOOL_BRUSH:
|
||||||
@@ -624,7 +585,11 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
|||||||
case BTN_TOOL_MOUSE:
|
case BTN_TOOL_MOUSE:
|
||||||
case BTN_TOOL_LENS:
|
case BTN_TOOL_LENS:
|
||||||
pEvdev->tool = value ? ev->code : 0;
|
pEvdev->tool = value ? ev->code : 0;
|
||||||
if (!(pEvdev->flags & EVDEV_TOUCHSCREEN))
|
break;
|
||||||
|
|
||||||
|
case BTN_TOUCH:
|
||||||
|
pEvdev->tool = value ? ev->code : 0;
|
||||||
|
if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)))
|
||||||
break;
|
break;
|
||||||
/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
|
/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
|
||||||
* BTN_LEFT. */
|
* BTN_LEFT. */
|
||||||
@@ -759,7 +724,6 @@ EvdevReadInput(InputInfoPtr pInfo)
|
|||||||
{
|
{
|
||||||
struct input_event ev[NUM_EVENTS];
|
struct input_event ev[NUM_EVENTS];
|
||||||
int i, len = sizeof(ev);
|
int i, len = sizeof(ev);
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
|
||||||
|
|
||||||
while (len == sizeof(ev))
|
while (len == sizeof(ev))
|
||||||
{
|
{
|
||||||
@@ -768,14 +732,10 @@ EvdevReadInput(InputInfoPtr pInfo)
|
|||||||
{
|
{
|
||||||
if (errno == ENODEV) /* May happen after resume */
|
if (errno == ENODEV) /* May happen after resume */
|
||||||
{
|
{
|
||||||
|
EvdevMBEmuFinalize(pInfo);
|
||||||
xf86RemoveEnabledDevice(pInfo);
|
xf86RemoveEnabledDevice(pInfo);
|
||||||
close(pInfo->fd);
|
close(pInfo->fd);
|
||||||
pInfo->fd = -1;
|
pInfo->fd = -1;
|
||||||
if (pEvdev->reopen_timer)
|
|
||||||
{
|
|
||||||
pEvdev->reopen_left = pEvdev->reopen_attempts;
|
|
||||||
pEvdev->reopen_timer = TimerSet(pEvdev->reopen_timer, 0, 100, EvdevReopenTimer, pInfo);
|
|
||||||
}
|
|
||||||
} else if (errno != EAGAIN)
|
} else if (errno != EAGAIN)
|
||||||
{
|
{
|
||||||
/* We use X_NONE here because it doesn't alloc */
|
/* We use X_NONE here because it doesn't alloc */
|
||||||
@@ -1190,6 +1150,7 @@ EvdevAddAbsClass(DeviceIntPtr device)
|
|||||||
EvdevPtr pEvdev;
|
EvdevPtr pEvdev;
|
||||||
int num_axes, axis, i = 0;
|
int num_axes, axis, i = 0;
|
||||||
Atom *atoms;
|
Atom *atoms;
|
||||||
|
const char *mode;
|
||||||
|
|
||||||
pInfo = device->public.devicePrivate;
|
pInfo = device->public.devicePrivate;
|
||||||
pEvdev = pInfo->private;
|
pEvdev = pInfo->private;
|
||||||
@@ -1261,6 +1222,22 @@ EvdevAddAbsClass(DeviceIntPtr device)
|
|||||||
TestBit(ABS_TILT_Y, pEvdev->abs_bitmask)))
|
TestBit(ABS_TILT_Y, pEvdev->abs_bitmask)))
|
||||||
pInfo->flags |= XI86_POINTER_CAPABLE;
|
pInfo->flags |= XI86_POINTER_CAPABLE;
|
||||||
|
|
||||||
|
if (pEvdev->flags & EVDEV_TOUCHPAD)
|
||||||
|
pEvdev->flags |= EVDEV_RELATIVE_MODE;
|
||||||
|
else
|
||||||
|
pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
|
||||||
|
|
||||||
|
if (xf86FindOption(pInfo->options, "Mode"))
|
||||||
|
{
|
||||||
|
mode = xf86SetStrOption(pInfo->options, "Mode", NULL);
|
||||||
|
if (!strcasecmp("absolute", mode))
|
||||||
|
pEvdev->flags &= ~EVDEV_RELATIVE_MODE;
|
||||||
|
else if (!strcasecmp("relative", mode))
|
||||||
|
pEvdev->flags |= EVDEV_RELATIVE_MODE;
|
||||||
|
else
|
||||||
|
xf86Msg(X_INFO, "%s: unknown mode, use default\n", pInfo->name);
|
||||||
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1322,6 +1299,9 @@ EvdevAddRelClass(DeviceIntPtr device)
|
|||||||
GetMotionHistorySize(), Relative))
|
GetMotionHistorySize(), Relative))
|
||||||
return !Success;
|
return !Success;
|
||||||
|
|
||||||
|
if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc))
|
||||||
|
return !Success;
|
||||||
|
|
||||||
for (axis = REL_X; axis <= REL_MAX; axis++)
|
for (axis = REL_X; axis <= REL_MAX; axis++)
|
||||||
{
|
{
|
||||||
int axnum = pEvdev->axis_map[axis];
|
int axnum = pEvdev->axis_map[axis];
|
||||||
@@ -1338,9 +1318,6 @@ EvdevAddRelClass(DeviceIntPtr device)
|
|||||||
|
|
||||||
xfree(atoms);
|
xfree(atoms);
|
||||||
|
|
||||||
if (!InitPtrFeedbackClassDeviceStruct(device, EvdevPtrCtrlProc))
|
|
||||||
return !Success;
|
|
||||||
|
|
||||||
pInfo->flags |= XI86_POINTER_CAPABLE;
|
pInfo->flags |= XI86_POINTER_CAPABLE;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
@@ -1421,6 +1398,17 @@ EvdevInitButtonMapping(InputInfoPtr pInfo)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
EvdevInitAnyClass(DeviceIntPtr device, EvdevPtr pEvdev)
|
||||||
|
{
|
||||||
|
if (pEvdev->flags & EVDEV_RELATIVE_EVENTS &&
|
||||||
|
EvdevAddRelClass(device) == Success)
|
||||||
|
xf86Msg(X_INFO, "%s: initialized for relative axes.\n", device->name);
|
||||||
|
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS &&
|
||||||
|
EvdevAddAbsClass(device) == Success)
|
||||||
|
xf86Msg(X_INFO, "%s: initialized for absolute axes.\n", device->name);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
EvdevInitAbsClass(DeviceIntPtr device, EvdevPtr pEvdev)
|
EvdevInitAbsClass(DeviceIntPtr device, EvdevPtr pEvdev)
|
||||||
{
|
{
|
||||||
@@ -1512,7 +1500,9 @@ EvdevInit(DeviceIntPtr device)
|
|||||||
* used and relative axes are ignored.
|
* used and relative axes are ignored.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN | EVDEV_TABLET))
|
if (pEvdev->flags & (EVDEV_UNIGNORE_RELATIVE | EVDEV_UNIGNORE_ABSOLUTE))
|
||||||
|
EvdevInitAnyClass(device, pEvdev);
|
||||||
|
else if (pEvdev->flags & (EVDEV_TOUCHPAD | EVDEV_TOUCHSCREEN | EVDEV_TABLET))
|
||||||
EvdevInitTouchDevice(device, pEvdev);
|
EvdevInitTouchDevice(device, pEvdev);
|
||||||
else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
|
else if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
|
||||||
EvdevInitRelClass(device, pEvdev);
|
EvdevInitRelClass(device, pEvdev);
|
||||||
@@ -1535,9 +1525,6 @@ EvdevInit(DeviceIntPtr device)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Init all extras (wheel emulation, etc.) and grab the device.
|
* Init all extras (wheel emulation, etc.) and grab the device.
|
||||||
*
|
|
||||||
* Coming from a resume, the grab may fail with ENODEV. In this case, we set a
|
|
||||||
* timer to wake up and try to reopen the device later.
|
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
EvdevOn(DeviceIntPtr device)
|
EvdevOn(DeviceIntPtr device)
|
||||||
@@ -1549,42 +1536,36 @@ EvdevOn(DeviceIntPtr device)
|
|||||||
pInfo = device->public.devicePrivate;
|
pInfo = device->public.devicePrivate;
|
||||||
pEvdev = pInfo->private;
|
pEvdev = pInfo->private;
|
||||||
|
|
||||||
if (pInfo->fd != -1 && pEvdev->grabDevice &&
|
if (pInfo->fd == -1) /* after PreInit fd is still open */
|
||||||
(rc = ioctl(pInfo->fd, EVIOCGRAB, (void *)1)))
|
|
||||||
{
|
{
|
||||||
|
do {
|
||||||
|
pInfo->fd = open(pEvdev->device, O_RDWR | O_NONBLOCK, 0);
|
||||||
|
} while (pInfo->fd < 0 && errno == EINTR);
|
||||||
|
|
||||||
|
if (pInfo->fd < 0) {
|
||||||
|
xf86Msg(X_ERROR, "Unable to open evdev device \"%s\".\n",
|
||||||
|
pEvdev->device);
|
||||||
|
return !Success;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pEvdev->grabDevice && (rc = ioctl(pInfo->fd, EVIOCGRAB, (void *)1)))
|
||||||
xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name,
|
xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name,
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
|
|
||||||
/* ENODEV - device has disappeared after resume */
|
pEvdev->min_maj = EvdevGetMajorMinor(pInfo);
|
||||||
if (rc && errno == ENODEV)
|
if (EvdevIsDuplicate(pInfo))
|
||||||
{
|
{
|
||||||
close(pInfo->fd);
|
xf86Msg(X_WARNING, "%s: Refusing to enable duplicate device.\n",
|
||||||
pInfo->fd = -1;
|
pInfo->name);
|
||||||
}
|
return !Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pInfo->fd == -1)
|
xf86FlushInput(pInfo->fd);
|
||||||
{
|
xf86AddEnabledDevice(pInfo);
|
||||||
pEvdev->reopen_left = pEvdev->reopen_attempts;
|
EvdevMBEmuOn(pInfo);
|
||||||
pEvdev->reopen_timer = TimerSet(pEvdev->reopen_timer, 0, 100, EvdevReopenTimer, pInfo);
|
pEvdev->flags |= EVDEV_INITIALIZED;
|
||||||
} else
|
device->public.on = TRUE;
|
||||||
{
|
|
||||||
pEvdev->min_maj = EvdevGetMajorMinor(pInfo);
|
|
||||||
if (EvdevIsDuplicate(pInfo))
|
|
||||||
{
|
|
||||||
xf86Msg(X_WARNING, "%s: Refusing to enable duplicate device.\n",
|
|
||||||
pInfo->name);
|
|
||||||
return !Success;
|
|
||||||
}
|
|
||||||
|
|
||||||
pEvdev->reopen_timer = TimerSet(pEvdev->reopen_timer, 0, 0, NULL, NULL);
|
|
||||||
|
|
||||||
xf86FlushInput(pInfo->fd);
|
|
||||||
xf86AddEnabledDevice(pInfo);
|
|
||||||
EvdevMBEmuOn(pInfo);
|
|
||||||
pEvdev->flags |= EVDEV_INITIALIZED;
|
|
||||||
device->public.on = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
@@ -1622,11 +1603,6 @@ EvdevProc(DeviceIntPtr device, int what)
|
|||||||
pEvdev->min_maj = 0;
|
pEvdev->min_maj = 0;
|
||||||
pEvdev->flags &= ~EVDEV_INITIALIZED;
|
pEvdev->flags &= ~EVDEV_INITIALIZED;
|
||||||
device->public.on = FALSE;
|
device->public.on = FALSE;
|
||||||
if (pEvdev->reopen_timer)
|
|
||||||
{
|
|
||||||
TimerFree(pEvdev->reopen_timer);
|
|
||||||
pEvdev->reopen_timer = NULL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DEVICE_CLOSE:
|
case DEVICE_CLOSE:
|
||||||
@@ -1655,6 +1631,7 @@ static int
|
|||||||
EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
|
EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
size_t len;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
char name[1024] = {0};
|
char name[1024] = {0};
|
||||||
@@ -1663,107 +1640,122 @@ EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
|
|||||||
unsigned long rel_bitmask[NLONGS(REL_CNT)] = {0};
|
unsigned long rel_bitmask[NLONGS(REL_CNT)] = {0};
|
||||||
unsigned long abs_bitmask[NLONGS(ABS_CNT)] = {0};
|
unsigned long abs_bitmask[NLONGS(ABS_CNT)] = {0};
|
||||||
unsigned long led_bitmask[NLONGS(LED_CNT)] = {0};
|
unsigned long led_bitmask[NLONGS(LED_CNT)] = {0};
|
||||||
struct input_absinfo absinfo[ABS_CNT];
|
|
||||||
|
|
||||||
if (ioctl(pInfo->fd,
|
if (ioctl(pInfo->fd, EVIOCGNAME(sizeof(name) - 1), name) < 0) {
|
||||||
EVIOCGNAME(sizeof(name) - 1), name) < 0) {
|
|
||||||
xf86Msg(X_ERROR, "ioctl EVIOCGNAME failed: %s\n", strerror(errno));
|
xf86Msg(X_ERROR, "ioctl EVIOCGNAME failed: %s\n", strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && strcmp(pEvdev->name, name)) {
|
if (!compare) {
|
||||||
xf86Msg(X_ERROR, "%s: device name changed: %s != %s\n", pInfo->name, pEvdev->name, name);
|
strcpy(pEvdev->name, name);
|
||||||
|
} else if (strcmp(pEvdev->name, name)) {
|
||||||
|
xf86Msg(X_ERROR, "%s: device name changed: %s != %s\n",
|
||||||
|
pInfo->name, pEvdev->name, name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(pInfo->fd,
|
len = ioctl(pInfo->fd, EVIOCGBIT(0, sizeof(bitmask)), bitmask);
|
||||||
EVIOCGBIT(0, sizeof(bitmask)), bitmask) < 0) {
|
if (len < 0) {
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n", pInfo->name, strerror(errno));
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n",
|
||||||
|
pInfo->name, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->bitmask, bitmask, sizeof(bitmask))) {
|
if (!compare) {
|
||||||
|
memcpy(pEvdev->bitmask, bitmask, len);
|
||||||
|
} else if (memcmp(pEvdev->bitmask, bitmask, len)) {
|
||||||
xf86Msg(X_ERROR, "%s: device bitmask has changed\n", pInfo->name);
|
xf86Msg(X_ERROR, "%s: device bitmask has changed\n", pInfo->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len = ioctl(pInfo->fd, EVIOCGBIT(EV_REL, sizeof(rel_bitmask)), rel_bitmask);
|
||||||
if (ioctl(pInfo->fd,
|
if (len < 0) {
|
||||||
EVIOCGBIT(EV_REL, sizeof(rel_bitmask)), rel_bitmask) < 0) {
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n",
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n", pInfo->name, strerror(errno));
|
pInfo->name, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->rel_bitmask, rel_bitmask, sizeof(rel_bitmask))) {
|
if (!compare) {
|
||||||
|
memcpy(pEvdev->rel_bitmask, rel_bitmask, len);
|
||||||
|
} else if (memcmp(pEvdev->rel_bitmask, rel_bitmask, len)) {
|
||||||
xf86Msg(X_ERROR, "%s: device rel_bitmask has changed\n", pInfo->name);
|
xf86Msg(X_ERROR, "%s: device rel_bitmask has changed\n", pInfo->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(pInfo->fd,
|
len = ioctl(pInfo->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bitmask)), abs_bitmask);
|
||||||
EVIOCGBIT(EV_ABS, sizeof(abs_bitmask)), abs_bitmask) < 0) {
|
if (len < 0) {
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n", pInfo->name, strerror(errno));
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n",
|
||||||
|
pInfo->name, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->abs_bitmask, abs_bitmask, sizeof(abs_bitmask))) {
|
if (!compare) {
|
||||||
|
memcpy(pEvdev->abs_bitmask, abs_bitmask, len);
|
||||||
|
} else if (memcmp(pEvdev->abs_bitmask, abs_bitmask, len)) {
|
||||||
xf86Msg(X_ERROR, "%s: device abs_bitmask has changed\n", pInfo->name);
|
xf86Msg(X_ERROR, "%s: device abs_bitmask has changed\n", pInfo->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ioctl(pInfo->fd,
|
len = ioctl(pInfo->fd, EVIOCGBIT(EV_LED, sizeof(led_bitmask)), led_bitmask);
|
||||||
EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask) < 0) {
|
if (len < 0) {
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n", pInfo->name, strerror(errno));
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n",
|
||||||
|
pInfo->name, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->key_bitmask, key_bitmask, sizeof(key_bitmask))) {
|
if (!compare) {
|
||||||
xf86Msg(X_ERROR, "%s: device key_bitmask has changed\n", pInfo->name);
|
memcpy(pEvdev->led_bitmask, led_bitmask, len);
|
||||||
goto error;
|
} else if (memcmp(pEvdev->led_bitmask, led_bitmask, len)) {
|
||||||
}
|
|
||||||
|
|
||||||
if (ioctl(pInfo->fd,
|
|
||||||
EVIOCGBIT(EV_LED, sizeof(led_bitmask)), led_bitmask) < 0) {
|
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n", pInfo->name, strerror(errno));
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->led_bitmask, led_bitmask, sizeof(led_bitmask))) {
|
|
||||||
xf86Msg(X_ERROR, "%s: device led_bitmask has changed\n", pInfo->name);
|
xf86Msg(X_ERROR, "%s: device led_bitmask has changed\n", pInfo->name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(absinfo, 0, sizeof(absinfo));
|
/*
|
||||||
|
* Do not try to validate absinfo data since it is not expected
|
||||||
for (i = ABS_X; i <= ABS_MAX; i++)
|
* to be static, always refresh it in evdev structure.
|
||||||
{
|
*/
|
||||||
if (TestBit(i, abs_bitmask))
|
for (i = ABS_X; i <= ABS_MAX; i++) {
|
||||||
{
|
if (TestBit(i, abs_bitmask)) {
|
||||||
if (ioctl(pInfo->fd, EVIOCGABS(i), &absinfo[i]) < 0) {
|
len = ioctl(pInfo->fd, EVIOCGABS(i), &pEvdev->absinfo[i]);
|
||||||
xf86Msg(X_ERROR, "%s: ioctl EVIOCGABS failed: %s\n", pInfo->name, strerror(errno));
|
if (len < 0) {
|
||||||
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGABSi(%d) failed: %s\n",
|
||||||
|
pInfo->name, i, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
/* ignore current position (value) in comparison (bug #19819) */
|
|
||||||
absinfo[i].value = pEvdev->absinfo[i].value;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compare && memcmp(pEvdev->absinfo, absinfo, sizeof(absinfo))) {
|
len = ioctl(pInfo->fd, EVIOCGBIT(EV_KEY, sizeof(key_bitmask)), key_bitmask);
|
||||||
xf86Msg(X_ERROR, "%s: device absinfo has changed\n", pInfo->name);
|
if (len < 0) {
|
||||||
|
xf86Msg(X_ERROR, "%s: ioctl EVIOCGBIT failed: %s\n",
|
||||||
|
pInfo->name, strerror(errno));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* cache info */
|
if (compare) {
|
||||||
if (!compare)
|
/*
|
||||||
{
|
* Keys are special as user can adjust keymap at any time (on
|
||||||
strcpy(pEvdev->name, name);
|
* devices that support EVIOCSKEYCODE. However we do not expect
|
||||||
memcpy(pEvdev->bitmask, bitmask, sizeof(bitmask));
|
* buttons reserved for mice/tablets/digitizers and so on to
|
||||||
memcpy(pEvdev->key_bitmask, key_bitmask, sizeof(key_bitmask));
|
* appear/disappear so we will check only those in
|
||||||
memcpy(pEvdev->rel_bitmask, rel_bitmask, sizeof(rel_bitmask));
|
* [BTN_MISC, KEY_OK) range.
|
||||||
memcpy(pEvdev->abs_bitmask, abs_bitmask, sizeof(abs_bitmask));
|
*/
|
||||||
memcpy(pEvdev->led_bitmask, led_bitmask, sizeof(led_bitmask));
|
size_t start_word = BTN_MISC / LONG_BITS;
|
||||||
memcpy(pEvdev->absinfo, absinfo, sizeof(absinfo));
|
size_t start_byte = start_word * sizeof(unsigned long);
|
||||||
|
size_t end_word = KEY_OK / LONG_BITS;
|
||||||
|
size_t end_byte = end_word * sizeof(unsigned long);
|
||||||
|
|
||||||
|
if (len >= start_byte &&
|
||||||
|
memcmp(&pEvdev->key_bitmask[start_word], &key_bitmask[start_word],
|
||||||
|
min(len, end_byte) - start_byte + 1)) {
|
||||||
|
xf86Msg(X_ERROR, "%s: device key_bitmask has changed\n", pInfo->name);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Copy the data so we have reasonably up-to-date info */
|
||||||
|
memcpy(pEvdev->key_bitmask, key_bitmask, len);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
@@ -1775,8 +1767,9 @@ static int
|
|||||||
EvdevProbe(InputInfoPtr pInfo)
|
EvdevProbe(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
int i, has_rel_axes, has_abs_axes, has_keys, num_buttons, has_scroll;
|
int i, has_rel_axes, has_abs_axes, has_keys, num_buttons, has_scroll;
|
||||||
|
int has_lmr; /* left middle right */
|
||||||
int kernel24 = 0;
|
int kernel24 = 0;
|
||||||
int ignore_rel, ignore_abs;
|
int ignore_abs = 0, ignore_rel = 0;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
if (pEvdev->grabDevice && ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) {
|
if (pEvdev->grabDevice && ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) {
|
||||||
@@ -1792,13 +1785,32 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
ioctl(pInfo->fd, EVIOCGRAB, (void *)0);
|
ioctl(pInfo->fd, EVIOCGRAB, (void *)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ignore_rel = xf86SetBoolOption(pInfo->options, "IgnoreRelativeAxes", FALSE);
|
/* Trinary state for ignoring axes:
|
||||||
ignore_abs = xf86SetBoolOption(pInfo->options, "IgnoreAbsoluteAxes", FALSE);
|
- unset: do the normal thing.
|
||||||
|
- TRUE: explicitly ignore them.
|
||||||
|
- FALSE: unignore axes, use them at all cost if they're present.
|
||||||
|
*/
|
||||||
|
if (xf86FindOption(pInfo->options, "IgnoreRelativeAxes"))
|
||||||
|
{
|
||||||
|
if (xf86SetBoolOption(pInfo->options, "IgnoreRelativeAxes", FALSE))
|
||||||
|
ignore_rel = TRUE;
|
||||||
|
else
|
||||||
|
pEvdev->flags |= EVDEV_UNIGNORE_RELATIVE;
|
||||||
|
|
||||||
|
}
|
||||||
|
if (xf86FindOption(pInfo->options, "IgnoreAbsoluteAxes"))
|
||||||
|
{
|
||||||
|
if (xf86SetBoolOption(pInfo->options, "IgnoreAbsoluteAxes", FALSE))
|
||||||
|
ignore_abs = TRUE;
|
||||||
|
else
|
||||||
|
pEvdev->flags |= EVDEV_UNIGNORE_ABSOLUTE;
|
||||||
|
}
|
||||||
|
|
||||||
has_rel_axes = FALSE;
|
has_rel_axes = FALSE;
|
||||||
has_abs_axes = FALSE;
|
has_abs_axes = FALSE;
|
||||||
has_keys = FALSE;
|
has_keys = FALSE;
|
||||||
has_scroll = FALSE;
|
has_scroll = FALSE;
|
||||||
|
has_lmr = FALSE;
|
||||||
num_buttons = 0;
|
num_buttons = 0;
|
||||||
|
|
||||||
/* count all buttons */
|
/* count all buttons */
|
||||||
@@ -1813,6 +1825,10 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
has_lmr = TestBit(BTN_LEFT, pEvdev->key_bitmask) ||
|
||||||
|
TestBit(BTN_MIDDLE, pEvdev->key_bitmask) ||
|
||||||
|
TestBit(BTN_RIGHT, pEvdev->key_bitmask);
|
||||||
|
|
||||||
if (num_buttons)
|
if (num_buttons)
|
||||||
{
|
{
|
||||||
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
|
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
|
||||||
@@ -1843,7 +1859,7 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
|
|
||||||
if (!ignore_rel)
|
if (!ignore_rel)
|
||||||
{
|
{
|
||||||
xf86Msg(X_INFO, "%s: found relative axes\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Found relative axes\n", pInfo->name);
|
||||||
pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
|
pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
|
||||||
|
|
||||||
if (TestBit(REL_X, pEvdev->rel_bitmask) &&
|
if (TestBit(REL_X, pEvdev->rel_bitmask) &&
|
||||||
@@ -1851,7 +1867,7 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
xf86Msg(X_INFO, "%s: Found x and y relative axes\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Found x and y relative axes\n", pInfo->name);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
xf86Msg(X_INFO, "%s: relative axes present but ignored.\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Relative axes present but ignored.\n", pInfo->name);
|
||||||
has_rel_axes = FALSE;
|
has_rel_axes = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1865,10 +1881,10 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
|
|
||||||
if (ignore_abs && has_abs_axes)
|
if (ignore_abs && has_abs_axes)
|
||||||
{
|
{
|
||||||
xf86Msg(X_INFO, "%s: absolute axes present but ignored.\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Absolute axes present but ignored.\n", pInfo->name);
|
||||||
has_abs_axes = FALSE;
|
has_abs_axes = FALSE;
|
||||||
} else if (has_abs_axes) {
|
} else if (has_abs_axes) {
|
||||||
xf86Msg(X_INFO, "%s: found absolute axes\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Found absolute axes\n", pInfo->name);
|
||||||
pEvdev->flags |= EVDEV_ABSOLUTE_EVENTS;
|
pEvdev->flags |= EVDEV_ABSOLUTE_EVENTS;
|
||||||
|
|
||||||
if ((TestBit(ABS_X, pEvdev->abs_bitmask) &&
|
if ((TestBit(ABS_X, pEvdev->abs_bitmask) &&
|
||||||
@@ -1878,9 +1894,14 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
{
|
{
|
||||||
xf86Msg(X_INFO, "%s: Found absolute tablet.\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Found absolute tablet.\n", pInfo->name);
|
||||||
pEvdev->flags |= EVDEV_TABLET;
|
pEvdev->flags |= EVDEV_TABLET;
|
||||||
|
if (!pEvdev->num_buttons)
|
||||||
|
{
|
||||||
|
pEvdev->num_buttons = 7; /* LMR + scroll wheels */
|
||||||
|
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
|
||||||
|
}
|
||||||
} else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
|
} else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
|
||||||
TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
|
TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
|
||||||
if (num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
|
if (has_lmr || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
|
||||||
xf86Msg(X_INFO, "%s: Found absolute touchpad.\n", pInfo->name);
|
xf86Msg(X_INFO, "%s: Found absolute touchpad.\n", pInfo->name);
|
||||||
pEvdev->flags |= EVDEV_TOUCHPAD;
|
pEvdev->flags |= EVDEV_TOUCHPAD;
|
||||||
memset(pEvdev->old_vals, -1, sizeof(int) * pEvdev->num_vals);
|
memset(pEvdev->old_vals, -1, sizeof(int) * pEvdev->num_vals);
|
||||||
@@ -1949,12 +1970,32 @@ EvdevProbe(InputInfoPtr pInfo)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
EvdevSetCalibration(InputInfoPtr pInfo, int num_calibration, int calibration[4])
|
||||||
|
{
|
||||||
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
|
|
||||||
|
if (num_calibration == 0) {
|
||||||
|
pEvdev->flags &= ~EVDEV_CALIBRATED;
|
||||||
|
pEvdev->calibration.min_x = 0;
|
||||||
|
pEvdev->calibration.max_x = 0;
|
||||||
|
pEvdev->calibration.min_y = 0;
|
||||||
|
pEvdev->calibration.max_y = 0;
|
||||||
|
} else if (num_calibration == 4) {
|
||||||
|
pEvdev->flags |= EVDEV_CALIBRATED;
|
||||||
|
pEvdev->calibration.min_x = calibration[0];
|
||||||
|
pEvdev->calibration.max_x = calibration[1];
|
||||||
|
pEvdev->calibration.min_y = calibration[2];
|
||||||
|
pEvdev->calibration.max_y = calibration[3];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static InputInfoPtr
|
static InputInfoPtr
|
||||||
EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo;
|
InputInfoPtr pInfo;
|
||||||
const char *device;
|
const char *device, *str;
|
||||||
|
int num_calibration = 0, calibration[4] = { 0, 0, 0, 0 };
|
||||||
EvdevPtr pEvdev;
|
EvdevPtr pEvdev;
|
||||||
|
|
||||||
if (!(pInfo = xf86AllocateInput(drv, 0)))
|
if (!(pInfo = xf86AllocateInput(drv, 0)))
|
||||||
@@ -1969,7 +2010,7 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
|||||||
pInfo->history_size = 0;
|
pInfo->history_size = 0;
|
||||||
pInfo->control_proc = NULL;
|
pInfo->control_proc = NULL;
|
||||||
pInfo->close_proc = NULL;
|
pInfo->close_proc = NULL;
|
||||||
pInfo->switch_mode = NULL;
|
pInfo->switch_mode = EvdevSwitchMode;
|
||||||
pInfo->conversion_proc = NULL;
|
pInfo->conversion_proc = NULL;
|
||||||
pInfo->reverse_conversion_proc = NULL;
|
pInfo->reverse_conversion_proc = NULL;
|
||||||
pInfo->dev = NULL;
|
pInfo->dev = NULL;
|
||||||
@@ -2022,11 +2063,23 @@ EvdevPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pEvdev->reopen_attempts = xf86SetIntOption(pInfo->options, "ReopenAttempts", 10);
|
|
||||||
pEvdev->invert_x = xf86SetBoolOption(pInfo->options, "InvertX", FALSE);
|
pEvdev->invert_x = xf86SetBoolOption(pInfo->options, "InvertX", FALSE);
|
||||||
pEvdev->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", FALSE);
|
pEvdev->invert_y = xf86SetBoolOption(pInfo->options, "InvertY", FALSE);
|
||||||
pEvdev->swap_axes = xf86SetBoolOption(pInfo->options, "SwapAxes", FALSE);
|
pEvdev->swap_axes = xf86SetBoolOption(pInfo->options, "SwapAxes", FALSE);
|
||||||
|
|
||||||
|
str = xf86CheckStrOption(pInfo->options, "Calibration", NULL);
|
||||||
|
if (str) {
|
||||||
|
num_calibration = sscanf(str, "%d %d %d %d",
|
||||||
|
&calibration[0], &calibration[1],
|
||||||
|
&calibration[2], &calibration[3]);
|
||||||
|
if (num_calibration == 4)
|
||||||
|
EvdevSetCalibration(pInfo, num_calibration, calibration);
|
||||||
|
else
|
||||||
|
xf86Msg(X_ERROR,
|
||||||
|
"%s: Insufficient calibration factors (%d). Ignoring calibration\n",
|
||||||
|
pInfo->name, num_calibration);
|
||||||
|
}
|
||||||
|
|
||||||
/* Grabbing the event device stops in-kernel event forwarding. In other
|
/* Grabbing the event device stops in-kernel event forwarding. In other
|
||||||
words, it disables rfkill and the "Macintosh mouse button emulation".
|
words, it disables rfkill and the "Macintosh mouse button emulation".
|
||||||
Note that this needs a server that sets the console to RAW mode. */
|
Note that this needs a server that sets the console to RAW mode. */
|
||||||
@@ -2318,16 +2371,16 @@ static void EvdevInitAxesLabels(EvdevPtr pEvdev, int natoms, Atom *atoms)
|
|||||||
int labels_len = 0;
|
int labels_len = 0;
|
||||||
char *misc_label;
|
char *misc_label;
|
||||||
|
|
||||||
if (pEvdev->flags & EVDEV_RELATIVE_EVENTS)
|
if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS)
|
||||||
{
|
|
||||||
labels = rel_labels;
|
|
||||||
labels_len = ArrayLength(rel_labels);
|
|
||||||
misc_label = AXIS_LABEL_PROP_REL_MISC;
|
|
||||||
} else if ((pEvdev->flags & EVDEV_ABSOLUTE_EVENTS))
|
|
||||||
{
|
{
|
||||||
labels = abs_labels;
|
labels = abs_labels;
|
||||||
labels_len = ArrayLength(abs_labels);
|
labels_len = ArrayLength(abs_labels);
|
||||||
misc_label = AXIS_LABEL_PROP_ABS_MISC;
|
misc_label = AXIS_LABEL_PROP_ABS_MISC;
|
||||||
|
} else if ((pEvdev->flags & EVDEV_RELATIVE_EVENTS))
|
||||||
|
{
|
||||||
|
labels = rel_labels;
|
||||||
|
labels_len = ArrayLength(rel_labels);
|
||||||
|
misc_label = AXIS_LABEL_PROP_REL_MISC;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(atoms, 0, natoms * sizeof(Atom));
|
memset(atoms, 0, natoms * sizeof(Atom));
|
||||||
@@ -2397,18 +2450,6 @@ EvdevInitProperty(DeviceIntPtr dev)
|
|||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
int rc;
|
int rc;
|
||||||
BOOL invert[2];
|
BOOL invert[2];
|
||||||
char reopen;
|
|
||||||
|
|
||||||
prop_reopen = MakeAtom(EVDEV_PROP_REOPEN, strlen(EVDEV_PROP_REOPEN),
|
|
||||||
TRUE);
|
|
||||||
|
|
||||||
reopen = pEvdev->reopen_attempts;
|
|
||||||
rc = XIChangeDeviceProperty(dev, prop_reopen, XA_INTEGER, 8,
|
|
||||||
PropModeReplace, 1, &reopen, FALSE);
|
|
||||||
if (rc != Success)
|
|
||||||
return;
|
|
||||||
|
|
||||||
XISetDevicePropertyDeletable(dev, prop_reopen, FALSE);
|
|
||||||
|
|
||||||
if (pEvdev->flags & (EVDEV_RELATIVE_EVENTS | EVDEV_ABSOLUTE_EVENTS))
|
if (pEvdev->flags & (EVDEV_RELATIVE_EVENTS | EVDEV_ABSOLUTE_EVENTS))
|
||||||
{
|
{
|
||||||
@@ -2427,8 +2468,22 @@ EvdevInitProperty(DeviceIntPtr dev)
|
|||||||
|
|
||||||
prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION,
|
prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION,
|
||||||
strlen(EVDEV_PROP_CALIBRATION), TRUE);
|
strlen(EVDEV_PROP_CALIBRATION), TRUE);
|
||||||
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER, 32,
|
if (pEvdev->flags & EVDEV_CALIBRATED) {
|
||||||
PropModeReplace, 0, NULL, FALSE);
|
int calibration[4];
|
||||||
|
|
||||||
|
calibration[0] = pEvdev->calibration.min_x;
|
||||||
|
calibration[1] = pEvdev->calibration.max_x;
|
||||||
|
calibration[2] = pEvdev->calibration.min_y;
|
||||||
|
calibration[3] = pEvdev->calibration.max_y;
|
||||||
|
|
||||||
|
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
|
||||||
|
32, PropModeReplace, 4, calibration,
|
||||||
|
FALSE);
|
||||||
|
} else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) {
|
||||||
|
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
|
||||||
|
32, PropModeReplace, 0, NULL,
|
||||||
|
FALSE);
|
||||||
|
}
|
||||||
if (rc != Success)
|
if (rc != Success)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -2487,13 +2542,6 @@ EvdevSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|||||||
pEvdev->invert_x = data[0];
|
pEvdev->invert_x = data[0];
|
||||||
pEvdev->invert_y = data[1];
|
pEvdev->invert_y = data[1];
|
||||||
}
|
}
|
||||||
} else if (atom == prop_reopen)
|
|
||||||
{
|
|
||||||
if (val->format != 8 || val->size != 1 || val->type != XA_INTEGER)
|
|
||||||
return BadMatch;
|
|
||||||
|
|
||||||
if (!checkonly)
|
|
||||||
pEvdev->reopen_attempts = *((CARD8*)val->data);
|
|
||||||
} else if (atom == prop_calibration)
|
} else if (atom == prop_calibration)
|
||||||
{
|
{
|
||||||
if (val->format != 32 || val->type != XA_INTEGER)
|
if (val->format != 32 || val->type != XA_INTEGER)
|
||||||
@@ -2502,25 +2550,7 @@ EvdevSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|||||||
return BadMatch;
|
return BadMatch;
|
||||||
|
|
||||||
if (!checkonly)
|
if (!checkonly)
|
||||||
{
|
EvdevSetCalibration(pInfo, val->size, val->data);
|
||||||
if (val->size == 0)
|
|
||||||
{
|
|
||||||
pEvdev->flags &= ~EVDEV_CALIBRATED;
|
|
||||||
pEvdev->calibration.min_x = 0;
|
|
||||||
pEvdev->calibration.max_x = 0;
|
|
||||||
pEvdev->calibration.min_y = 0;
|
|
||||||
pEvdev->calibration.max_y = 0;
|
|
||||||
} else if (val->size == 4)
|
|
||||||
{
|
|
||||||
CARD32 *vals = (CARD32*)val->data;
|
|
||||||
|
|
||||||
pEvdev->flags |= EVDEV_CALIBRATED;
|
|
||||||
pEvdev->calibration.min_x = vals[0];
|
|
||||||
pEvdev->calibration.max_x = vals[1];
|
|
||||||
pEvdev->calibration.min_y = vals[2];
|
|
||||||
pEvdev->calibration.max_y = vals[3];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (atom == prop_swap)
|
} else if (atom == prop_swap)
|
||||||
{
|
{
|
||||||
if (val->format != 8 || val->type != XA_INTEGER || val->size != 1)
|
if (val->format != 8 || val->type != XA_INTEGER || val->size != 1)
|
||||||
|
|||||||
16
src/evdev.h
16
src/evdev.h
@@ -38,7 +38,7 @@
|
|||||||
#include <xf86_OSproc.h>
|
#include <xf86_OSproc.h>
|
||||||
#include <xkbstr.h>
|
#include <xkbstr.h>
|
||||||
|
|
||||||
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */
|
#ifndef EV_CNT /* linux 2.6.23 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
|
||||||
@@ -57,6 +57,20 @@
|
|||||||
#define EVDEV_MAXBUTTONS 32
|
#define EVDEV_MAXBUTTONS 32
|
||||||
#define EVDEV_MAXQUEUE 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
|
||||||
|
|||||||
Reference in New Issue
Block a user