mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
94 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01e7ac4854 | ||
|
|
034be31159 | ||
|
|
66c9978864 | ||
|
|
0d3494eadf | ||
|
|
56a5e67162 | ||
|
|
74433f788a | ||
|
|
fdc33809de | ||
|
|
38e107a39f | ||
|
|
b6176cff5a | ||
|
|
37afebfb67 | ||
|
|
5b5ae1786c | ||
|
|
2c9f4f0380 | ||
|
|
39ef4444a2 | ||
|
|
abc4a8b603 | ||
|
|
b370ccdff8 | ||
|
|
511498478b | ||
|
|
3dcf6f123c | ||
|
|
f59585b367 | ||
|
|
593bbc6390 | ||
|
|
e0e2587a95 | ||
|
|
cb3b023783 | ||
|
|
124eff9ba2 | ||
|
|
605047613c | ||
|
|
3ee98d0b7f | ||
|
|
977588d24a | ||
|
|
291b60172d | ||
|
|
8ce06c96e4 | ||
|
|
5d239ceb26 | ||
|
|
13dea90bc8 | ||
|
|
b25d716165 | ||
|
|
41cf9212d0 | ||
|
|
75368052b5 | ||
|
|
16c85cbeac | ||
|
|
ae67f64f02 | ||
|
|
f6fcad8b10 | ||
|
|
d171b3d919 | ||
|
|
c3251deb4b | ||
|
|
cabed4bbb6 | ||
|
|
a75c43830e | ||
|
|
d9aadfd5f0 | ||
|
|
54a3120e33 | ||
|
|
164c62a975 | ||
|
|
43e270fb7a | ||
|
|
4ca57716ca | ||
|
|
0f16065b00 | ||
|
|
cae1478781 | ||
|
|
27926b3763 | ||
|
|
8a9b1ec6b5 | ||
|
|
356565111a | ||
|
|
fff3a60fbf | ||
|
|
8f209ac60d | ||
|
|
a0d41af896 | ||
|
|
dea1d1a390 | ||
|
|
b59a1a25da | ||
|
|
5138cd2ff4 | ||
|
|
c085c8b6c1 | ||
|
|
2b675f85ae | ||
|
|
2b8b0df62e | ||
|
|
bb9b4146cb | ||
|
|
f5fe533f1b | ||
|
|
2f67509b53 | ||
|
|
ffc0a34642 | ||
|
|
93de7b0b73 | ||
|
|
9ec9d214d0 | ||
|
|
94e6df8f5f | ||
|
|
67e5376aaa | ||
|
|
2432626b70 | ||
|
|
069c035ab0 | ||
|
|
3b7ba39fca | ||
|
|
454194f4b5 | ||
|
|
00341e632c | ||
|
|
f2d2b65343 | ||
|
|
0d6c6b59c1 | ||
|
|
c263d6e46d | ||
|
|
5af11b6752 | ||
|
|
33e7831b5f | ||
|
|
bc8997e812 | ||
|
|
1cb8f074df | ||
|
|
4eacb581fb | ||
|
|
98af2003d4 | ||
|
|
f5ede98085 | ||
|
|
ff926d15b8 | ||
|
|
b0e3c8f978 | ||
|
|
9624f4e2ba | ||
|
|
047955f51e | ||
|
|
8251d7a8ec | ||
|
|
ac5173163d | ||
|
|
61faf2e6e7 | ||
|
|
7f3f98be7f | ||
|
|
4145fe1c08 | ||
|
|
9ce068e760 | ||
|
|
2c8da280b3 | ||
|
|
f28507e8ce | ||
|
|
99340147b9 |
40
10-evdev.conf
Normal file
40
10-evdev.conf
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# Catch-all evdev loader for udev-based systems
|
||||||
|
# We don't simply match on any device since that also adds accelerometers
|
||||||
|
# and other devices that we don't really want to use. The list below
|
||||||
|
# matches everything but joysticks.
|
||||||
|
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "evdev pointer catchall"
|
||||||
|
MatchIsPointer "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "evdev keyboard catchall"
|
||||||
|
MatchIsKeyboard "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "evdev touchpad catchall"
|
||||||
|
MatchIsTouchpad "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "evdev tablet catchall"
|
||||||
|
MatchIsTablet "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
EndSection
|
||||||
|
|
||||||
|
Section "InputClass"
|
||||||
|
Identifier "evdev touchscreen catchall"
|
||||||
|
MatchIsTouchscreen "on"
|
||||||
|
MatchDevicePath "/dev/input/event*"
|
||||||
|
Driver "evdev"
|
||||||
|
EndSection
|
||||||
@@ -28,6 +28,7 @@ MAINTAINERCLEANFILES = ChangeLog INSTALL
|
|||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = xorg-evdev.pc
|
pkgconfig_DATA = xorg-evdev.pc
|
||||||
|
|
||||||
|
dist_xorgconf_DATA = 10-evdev.conf
|
||||||
|
|
||||||
.PHONY: ChangeLog INSTALL
|
.PHONY: ChangeLog INSTALL
|
||||||
|
|
||||||
|
|||||||
@@ -9,4 +9,6 @@ cd $srcdir
|
|||||||
autoreconf -v --install || exit 1
|
autoreconf -v --install || exit 1
|
||||||
cd $ORIGDIR || exit $?
|
cd $ORIGDIR || exit $?
|
||||||
|
|
||||||
$srcdir/configure --enable-maintainer-mode "$@"
|
if test -z "$NOCONFIGURE"; then
|
||||||
|
$srcdir/configure "$@"
|
||||||
|
fi
|
||||||
|
|||||||
23
configure.ac
23
configure.ac
@@ -23,7 +23,7 @@
|
|||||||
# Initialize Autoconf
|
# Initialize Autoconf
|
||||||
AC_PREREQ([2.60])
|
AC_PREREQ([2.60])
|
||||||
AC_INIT([xf86-input-evdev],
|
AC_INIT([xf86-input-evdev],
|
||||||
[2.7.1],
|
[2.10.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])
|
||||||
@@ -32,7 +32,6 @@ AC_CONFIG_AUX_DIR(.)
|
|||||||
|
|
||||||
# Initialize Automake
|
# Initialize Automake
|
||||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||||
AM_MAINTAINER_MODE
|
|
||||||
|
|
||||||
# Initialize libtool
|
# Initialize libtool
|
||||||
AC_DISABLE_STATIC
|
AC_DISABLE_STATIC
|
||||||
@@ -45,18 +44,11 @@ XORG_MACROS_VERSION(1.8)
|
|||||||
XORG_DEFAULT_OPTIONS
|
XORG_DEFAULT_OPTIONS
|
||||||
|
|
||||||
# Obtain compiler/linker options from server and required extensions
|
# Obtain compiler/linker options from server and required extensions
|
||||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
|
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.12] xproto [inputproto >= 2.1.99.3])
|
||||||
PKG_CHECK_MODULES(UDEV, libudev)
|
PKG_CHECK_MODULES(UDEV, libudev)
|
||||||
|
|
||||||
PKG_CHECK_MODULES(XI22, [inputproto >= 2.1.99.3] [xorg-server >= 1.11.99.901], HAVE_XI22="yes", HAVE_XI22="no")
|
PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
|
||||||
|
PKG_CHECK_MODULES(MTDEV, mtdev)
|
||||||
if test "x$HAVE_XI22" = xyes; then
|
|
||||||
# Obtain compiler/linker options for mtdev
|
|
||||||
PKG_CHECK_MODULES(MTDEV, mtdev, HAVE_MTDEV="yes", HAVE_MTDEV="no")
|
|
||||||
fi
|
|
||||||
if test "x$HAVE_XI22" = xyes && test "x$HAVE_MTDEV" = xyes; then
|
|
||||||
AC_DEFINE(MULTITOUCH, 1, [XI2.2 available])
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Define a configure option for an alternate input module directory
|
# Define a configure option for an alternate input module directory
|
||||||
AC_ARG_WITH(xorg-module-dir,
|
AC_ARG_WITH(xorg-module-dir,
|
||||||
@@ -67,6 +59,13 @@ AC_ARG_WITH(xorg-module-dir,
|
|||||||
inputdir=${moduledir}/input
|
inputdir=${moduledir}/input
|
||||||
AC_SUBST(inputdir)
|
AC_SUBST(inputdir)
|
||||||
|
|
||||||
|
AC_ARG_WITH(xorg-conf-dir,
|
||||||
|
AC_HELP_STRING([--with-xorg-conf-dir=DIR],
|
||||||
|
[Default xorg.conf.d directory [[default=$prefix/share/X11/xorg.conf.d/]]]),
|
||||||
|
[xorgconfdir="$withval"],
|
||||||
|
[xorgconfdir="$prefix/share/X11/xorg.conf.d"])
|
||||||
|
AC_SUBST(xorgconfdir)
|
||||||
|
|
||||||
# X Server SDK location is required to install evdev header files
|
# X Server SDK location is required to install evdev header files
|
||||||
# This location is also relayed in the xorg-evdev.pc file
|
# This location is also relayed in the xorg-evdev.pc file
|
||||||
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
|
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
|
||||||
|
|||||||
@@ -87,4 +87,8 @@
|
|||||||
*/
|
*/
|
||||||
#define EVDEV_PROP_FUNCTION_KEYS "Evdev Function Keys"
|
#define EVDEV_PROP_FUNCTION_KEYS "Evdev Function Keys"
|
||||||
|
|
||||||
|
/* Smooth scroll */
|
||||||
|
/* INT32, 3 values (vertical, horizontal, dial) */
|
||||||
|
#define EVDEV_PROP_SCROLL_DISTANCE "Evdev Scrolling Distance"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -220,6 +220,30 @@ 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 \*qTypeName\*q \*q"type"\*q
|
||||||
|
Specify the X Input 1.x type (see XListInputDevices(__libmansuffix__)).
|
||||||
|
There is rarely a need to use this option, evdev will guess the device type
|
||||||
|
based on the device's capabilities. This option is provided for devices that
|
||||||
|
need quirks.
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qVertScrollDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of scrolling vertically.
|
||||||
|
Default: "1". Property: "Evdev Scrolling Distance".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qHorizScrollDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of scrolling horizontally.
|
||||||
|
Default: "1". Property: "Evdev Scrolling Distance".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qDialDelta\*q \*q" integer \*q
|
||||||
|
The amount of motion considered one unit of turning the dial. Default: "1".
|
||||||
|
Property: "Evdev Scrolling Distance".
|
||||||
|
.TP 7
|
||||||
|
.BI "Option \*qResolution\*q \*q" integer \*q
|
||||||
|
Sets the resolution of the device in dots per inch. The resolution is used
|
||||||
|
to scale relative motion events from mouse devices to 1000 DPI resolution. This
|
||||||
|
can be used to make high resolution mice less sensitive without turning off
|
||||||
|
acceleration. If set to 0 no scaling will be performed. Default: "0".
|
||||||
|
|
||||||
.SH SUPPORTED PROPERTIES
|
.SH SUPPORTED PROPERTIES
|
||||||
The following properties are provided by the
|
The following properties are provided by the
|
||||||
@@ -260,6 +284,9 @@ 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 Scrolling Distance"
|
||||||
|
3 32-bit values: vertical, horizontal and dial.
|
||||||
|
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
Kristian Høgsberg, Peter Hutterer
|
Kristian Høgsberg, Peter Hutterer
|
||||||
|
|||||||
@@ -26,11 +26,11 @@
|
|||||||
# 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)
|
AM_CFLAGS = $(XORG_CFLAGS) $(CWARNFLAGS)
|
||||||
AM_CPPFLAGS =-I$(top_srcdir)/include
|
AM_CPPFLAGS =-I$(top_srcdir)/include $(LIBEVDEV_CFLAGS)
|
||||||
|
|
||||||
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
@DRIVER_NAME@_drv_la_LTLIBRARIES = @DRIVER_NAME@_drv.la
|
||||||
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
|
@DRIVER_NAME@_drv_la_LDFLAGS = -module -avoid-version
|
||||||
@DRIVER_NAME@_drv_la_LIBADD = $(MTDEV_LIBS)
|
@DRIVER_NAME@_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||||
@DRIVER_NAME@_drv_ladir = @inputdir@
|
@DRIVER_NAME@_drv_ladir = @inputdir@
|
||||||
|
|
||||||
@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \
|
@DRIVER_NAME@_drv_la_SOURCES = @DRIVER_NAME@.c \
|
||||||
@@ -39,5 +39,6 @@ AM_CPPFLAGS =-I$(top_srcdir)/include
|
|||||||
emuThird.c \
|
emuThird.c \
|
||||||
emuWheel.c \
|
emuWheel.c \
|
||||||
draglock.c \
|
draglock.c \
|
||||||
apple.c
|
apple.c \
|
||||||
|
axis_labels.h
|
||||||
|
|
||||||
|
|||||||
@@ -303,7 +303,8 @@ EvdevAppleInitProperty(DeviceIntPtr dev)
|
|||||||
enum fkeymode fkeymode;
|
enum fkeymode fkeymode;
|
||||||
|
|
||||||
if (!product_check(apple_keyboard_table,
|
if (!product_check(apple_keyboard_table,
|
||||||
pEvdev->id_vendor, pEvdev->id_product))
|
libevdev_get_id_vendor(pEvdev->dev),
|
||||||
|
libevdev_get_id_product(pEvdev->dev)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fkeymode = get_fnmode();
|
fkeymode = get_fnmode();
|
||||||
|
|||||||
198
src/axis_labels.h
Normal file
198
src/axis_labels.h
Normal file
@@ -0,0 +1,198 @@
|
|||||||
|
/*
|
||||||
|
* Copyright © 2004-2008 Red Hat, Inc.
|
||||||
|
*
|
||||||
|
* Permission to use, copy, modify, distribute, and sell this software
|
||||||
|
* and its documentation for any purpose is hereby granted without
|
||||||
|
* fee, provided that the above copyright notice appear in all copies
|
||||||
|
* and that both that copyright notice and this permission notice
|
||||||
|
* appear in supporting documentation, and that the name of Red Hat
|
||||||
|
* not be used in advertising or publicity pertaining to distribution
|
||||||
|
* of the software without specific, written prior permission. Red
|
||||||
|
* Hat makes no representations about the suitability of this software
|
||||||
|
* for any purpose. It is provided "as is" without express or implied
|
||||||
|
* warranty.
|
||||||
|
*
|
||||||
|
* THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
|
||||||
|
* NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||||
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
|
||||||
|
* OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
|
||||||
|
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
||||||
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <xserver-properties.h>
|
||||||
|
|
||||||
|
#ifndef AXIS_LABELS
|
||||||
|
#define AXIS_LABELS
|
||||||
|
|
||||||
|
/* Aligned with linux/input.h.
|
||||||
|
Note that there are holes in the ABS_ range, these are simply replaced with
|
||||||
|
MISC here */
|
||||||
|
static const char* abs_labels[] = {
|
||||||
|
AXIS_LABEL_PROP_ABS_X, /* 0x00 */
|
||||||
|
AXIS_LABEL_PROP_ABS_Y, /* 0x01 */
|
||||||
|
AXIS_LABEL_PROP_ABS_Z, /* 0x02 */
|
||||||
|
AXIS_LABEL_PROP_ABS_RX, /* 0x03 */
|
||||||
|
AXIS_LABEL_PROP_ABS_RY, /* 0x04 */
|
||||||
|
AXIS_LABEL_PROP_ABS_RZ, /* 0x05 */
|
||||||
|
AXIS_LABEL_PROP_ABS_THROTTLE, /* 0x06 */
|
||||||
|
AXIS_LABEL_PROP_ABS_RUDDER, /* 0x07 */
|
||||||
|
AXIS_LABEL_PROP_ABS_WHEEL, /* 0x08 */
|
||||||
|
AXIS_LABEL_PROP_ABS_GAS, /* 0x09 */
|
||||||
|
AXIS_LABEL_PROP_ABS_BRAKE, /* 0x0a */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT0X, /* 0x10 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT0Y, /* 0x11 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT1X, /* 0x12 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT1Y, /* 0x13 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT2X, /* 0x14 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT2Y, /* 0x15 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT3X, /* 0x16 */
|
||||||
|
AXIS_LABEL_PROP_ABS_HAT3Y, /* 0x17 */
|
||||||
|
AXIS_LABEL_PROP_ABS_PRESSURE, /* 0x18 */
|
||||||
|
AXIS_LABEL_PROP_ABS_DISTANCE, /* 0x19 */
|
||||||
|
AXIS_LABEL_PROP_ABS_TILT_X, /* 0x1a */
|
||||||
|
AXIS_LABEL_PROP_ABS_TILT_Y, /* 0x1b */
|
||||||
|
AXIS_LABEL_PROP_ABS_TOOL_WIDTH, /* 0x1c */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_VOLUME /* 0x20 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MISC, /* undefined */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR, /* 0x30 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR, /* 0x31 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR, /* 0x32 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR, /* 0x33 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_ORIENTATION, /* 0x34 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_POSITION_X, /* 0x35 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_POSITION_Y, /* 0x36 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE, /* 0x37 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_BLOB_ID, /* 0x38 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TRACKING_ID, /* 0x39 */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_PRESSURE, /* 0x3a */
|
||||||
|
#ifdef AXIS_LABEL_PROP_ABS_MT_DISTANCE
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_DISTANCE, /* 0x3b */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TOOL_X, /* 0x3c */
|
||||||
|
AXIS_LABEL_PROP_ABS_MT_TOOL_Y, /* 0x3d */
|
||||||
|
#endif /* AXIS_LABEL_PROP_ABS_MT_DISTANCE */
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char* rel_labels[] = {
|
||||||
|
AXIS_LABEL_PROP_REL_X,
|
||||||
|
AXIS_LABEL_PROP_REL_Y,
|
||||||
|
AXIS_LABEL_PROP_REL_Z,
|
||||||
|
AXIS_LABEL_PROP_REL_RX,
|
||||||
|
AXIS_LABEL_PROP_REL_RY,
|
||||||
|
AXIS_LABEL_PROP_REL_RZ,
|
||||||
|
AXIS_LABEL_PROP_REL_HWHEEL,
|
||||||
|
AXIS_LABEL_PROP_REL_DIAL,
|
||||||
|
AXIS_LABEL_PROP_REL_WHEEL,
|
||||||
|
AXIS_LABEL_PROP_REL_MISC
|
||||||
|
};
|
||||||
|
|
||||||
|
static const char* btn_labels[][16] = {
|
||||||
|
{ /* BTN_MISC group offset 0x100*/
|
||||||
|
BTN_LABEL_PROP_BTN_0, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_1, /* 0x01 */
|
||||||
|
BTN_LABEL_PROP_BTN_2, /* 0x02 */
|
||||||
|
BTN_LABEL_PROP_BTN_3, /* 0x03 */
|
||||||
|
BTN_LABEL_PROP_BTN_4, /* 0x04 */
|
||||||
|
BTN_LABEL_PROP_BTN_5, /* 0x05 */
|
||||||
|
BTN_LABEL_PROP_BTN_6, /* 0x06 */
|
||||||
|
BTN_LABEL_PROP_BTN_7, /* 0x07 */
|
||||||
|
BTN_LABEL_PROP_BTN_8, /* 0x08 */
|
||||||
|
BTN_LABEL_PROP_BTN_9 /* 0x09 */
|
||||||
|
},
|
||||||
|
{ /* BTN_MOUSE group offset 0x110 */
|
||||||
|
BTN_LABEL_PROP_BTN_LEFT, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_RIGHT, /* 0x01 */
|
||||||
|
BTN_LABEL_PROP_BTN_MIDDLE, /* 0x02 */
|
||||||
|
BTN_LABEL_PROP_BTN_SIDE, /* 0x03 */
|
||||||
|
BTN_LABEL_PROP_BTN_EXTRA, /* 0x04 */
|
||||||
|
BTN_LABEL_PROP_BTN_FORWARD, /* 0x05 */
|
||||||
|
BTN_LABEL_PROP_BTN_BACK, /* 0x06 */
|
||||||
|
BTN_LABEL_PROP_BTN_TASK /* 0x07 */
|
||||||
|
},
|
||||||
|
{ /* BTN_JOYSTICK group offset 0x120 */
|
||||||
|
BTN_LABEL_PROP_BTN_TRIGGER, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_THUMB, /* 0x01 */
|
||||||
|
BTN_LABEL_PROP_BTN_THUMB2, /* 0x02 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOP, /* 0x03 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOP2, /* 0x04 */
|
||||||
|
BTN_LABEL_PROP_BTN_PINKIE, /* 0x05 */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE, /* 0x06 */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE2, /* 0x07 */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE3, /* 0x08 */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE4, /* 0x09 */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE5, /* 0x0a */
|
||||||
|
BTN_LABEL_PROP_BTN_BASE6, /* 0x0b */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
BTN_LABEL_PROP_BTN_DEAD /* 0x0f */
|
||||||
|
},
|
||||||
|
{ /* BTN_GAMEPAD group offset 0x130 */
|
||||||
|
BTN_LABEL_PROP_BTN_A, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_B, /* 0x01 */
|
||||||
|
BTN_LABEL_PROP_BTN_C, /* 0x02 */
|
||||||
|
BTN_LABEL_PROP_BTN_X, /* 0x03 */
|
||||||
|
BTN_LABEL_PROP_BTN_Y, /* 0x04 */
|
||||||
|
BTN_LABEL_PROP_BTN_Z, /* 0x05 */
|
||||||
|
BTN_LABEL_PROP_BTN_TL, /* 0x06 */
|
||||||
|
BTN_LABEL_PROP_BTN_TR, /* 0x07 */
|
||||||
|
BTN_LABEL_PROP_BTN_TL2, /* 0x08 */
|
||||||
|
BTN_LABEL_PROP_BTN_TR2, /* 0x09 */
|
||||||
|
BTN_LABEL_PROP_BTN_SELECT, /* 0x0a */
|
||||||
|
BTN_LABEL_PROP_BTN_START, /* 0x0b */
|
||||||
|
BTN_LABEL_PROP_BTN_MODE, /* 0x0c */
|
||||||
|
BTN_LABEL_PROP_BTN_THUMBL, /* 0x0d */
|
||||||
|
BTN_LABEL_PROP_BTN_THUMBR /* 0x0e */
|
||||||
|
},
|
||||||
|
{ /* BTN_DIGI group offset 0x140 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_PEN, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_RUBBER, /* 0x01 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_BRUSH, /* 0x02 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_PENCIL, /* 0x03 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH, /* 0x04 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_FINGER, /* 0x05 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_MOUSE, /* 0x06 */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_LENS, /* 0x07 */
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
BTN_LABEL_PROP_BTN_TOUCH, /* 0x0a */
|
||||||
|
BTN_LABEL_PROP_BTN_STYLUS, /* 0x0b */
|
||||||
|
BTN_LABEL_PROP_BTN_STYLUS2, /* 0x0c */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP, /* 0x0d */
|
||||||
|
BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP /* 0x0e */
|
||||||
|
},
|
||||||
|
{ /* BTN_WHEEL group offset 0x150 */
|
||||||
|
BTN_LABEL_PROP_BTN_GEAR_DOWN, /* 0x00 */
|
||||||
|
BTN_LABEL_PROP_BTN_GEAR_UP /* 0x01 */
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
@@ -196,8 +196,8 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
|
|||||||
pEvdev->emulateMB.state =
|
pEvdev->emulateMB.state =
|
||||||
stateTab[pEvdev->emulateMB.state][4][2];
|
stateTab[pEvdev->emulateMB.state][4][2];
|
||||||
} else {
|
} else {
|
||||||
ErrorF("Got unexpected buttonTimer in state %d\n",
|
xf86IDrvMsg(pInfo, X_ERROR, "Got unexpected buttonTimer in state %d\n",
|
||||||
pEvdev->emulateMB.state);
|
pEvdev->emulateMB.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86UnblockSIGIO (sigstate);
|
xf86UnblockSIGIO (sigstate);
|
||||||
|
|||||||
@@ -229,8 +229,8 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals)
|
|||||||
{
|
{
|
||||||
if (valuator_mask_isset(vals, axis))
|
if (valuator_mask_isset(vals, axis))
|
||||||
{
|
{
|
||||||
int delta = valuator_mask_get(vals, axis) - emu3B->startpos[axis];
|
double delta = valuator_mask_get_double(vals, axis) - emu3B->startpos[axis];
|
||||||
if (abs(delta) > emu3B->threshold)
|
if (fabs(delta) > emu3B->threshold)
|
||||||
cancel = TRUE;
|
cancel = TRUE;
|
||||||
}
|
}
|
||||||
axis++;
|
axis++;
|
||||||
@@ -248,7 +248,7 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals)
|
|||||||
* emulation.
|
* emulation.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy)
|
Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
||||||
@@ -260,8 +260,8 @@ Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy)
|
|||||||
emu3B->delta[1] += dy;
|
emu3B->delta[1] += dy;
|
||||||
emu3B->flags |= EVDEV_RELATIVE_EVENTS;
|
emu3B->flags |= EVDEV_RELATIVE_EVENTS;
|
||||||
|
|
||||||
if (abs(emu3B->delta[0]) > emu3B->threshold ||
|
if (fabs(emu3B->delta[0]) > emu3B->threshold ||
|
||||||
abs(emu3B->delta[1]) > emu3B->threshold)
|
fabs(emu3B->delta[1]) > emu3B->threshold)
|
||||||
{
|
{
|
||||||
Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
|
Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS);
|
||||||
Evdev3BCancel(pInfo);
|
Evdev3BCancel(pInfo);
|
||||||
|
|||||||
@@ -51,7 +51,6 @@ static Atom prop_wheel_timeout = 0;
|
|||||||
static Atom prop_wheel_button = 0;
|
static Atom prop_wheel_button = 0;
|
||||||
|
|
||||||
/* Local Funciton Prototypes */
|
/* Local Funciton Prototypes */
|
||||||
static BOOL EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char *axis_name);
|
|
||||||
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
|
static int EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value);
|
||||||
|
|
||||||
/* Filter mouse button events */
|
/* Filter mouse button events */
|
||||||
@@ -98,7 +97,6 @@ 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)
|
||||||
@@ -116,12 +114,15 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We don't want to intercept real mouse wheel events */
|
|
||||||
if(pEv->type == EV_ABS) {
|
if(pEv->type == EV_ABS) {
|
||||||
int axis = pEvdev->axis_map[pEv->code];
|
int axis = pEvdev->abs_axis_map[pEv->code];
|
||||||
oldValue = valuator_mask_get(pEvdev->vals, axis);
|
int oldValue;
|
||||||
valuator_mask_set(pEvdev->vals, axis, value);
|
|
||||||
value -= oldValue; /* make value into a differential measurement */
|
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
|
||||||
|
valuator_mask_set(pEvdev->abs_vals, axis, value);
|
||||||
|
value -= oldValue; /* make value into a differential measurement */
|
||||||
|
} else
|
||||||
|
value = 0; /* avoid a jump on the first touch */
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(pEv->code) {
|
switch(pEv->code) {
|
||||||
@@ -197,7 +198,8 @@ EvdevWheelEmuInertia(InputInfoPtr pInfo, WheelAxisPtr axis, int value)
|
|||||||
/* Handle button mapping here to avoid code duplication,
|
/* Handle button mapping here to avoid code duplication,
|
||||||
returns true if a button mapping was found. */
|
returns true if a button mapping was found. */
|
||||||
static BOOL
|
static BOOL
|
||||||
EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis, char* axis_name)
|
EvdevWheelEmuHandleButtonMap(InputInfoPtr pInfo, WheelAxisPtr pAxis,
|
||||||
|
const char *axis_name)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
char *option_string;
|
char *option_string;
|
||||||
@@ -392,7 +394,7 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
|
|||||||
|
|
||||||
inertia = *((CARD16*)val->data);
|
inertia = *((CARD16*)val->data);
|
||||||
|
|
||||||
if (inertia < 0)
|
if (inertia <= 0)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (!checkonly)
|
if (!checkonly)
|
||||||
|
|||||||
1778
src/evdev.c
1778
src/evdev.c
File diff suppressed because it is too large
Load Diff
70
src/evdev.h
70
src/evdev.h
@@ -43,9 +43,9 @@
|
|||||||
#include <xf86_OSproc.h>
|
#include <xf86_OSproc.h>
|
||||||
#include <xkbstr.h>
|
#include <xkbstr.h>
|
||||||
|
|
||||||
#ifdef MULTITOUCH
|
|
||||||
#include <mtdev.h>
|
#include <mtdev.h>
|
||||||
#endif
|
|
||||||
|
#include <libevdev/libevdev.h>
|
||||||
|
|
||||||
#ifndef EV_CNT /* linux 2.6.23 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)
|
||||||
@@ -63,8 +63,8 @@
|
|||||||
#define LED_CNT (LED_MAX+1)
|
#define LED_CNT (LED_MAX+1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
|
||||||
#define HAVE_SMOOTH_SCROLLING 1
|
#define LogMessageVerbSigSafe xf86MsgVerb
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define EVDEV_MAXBUTTONS 32
|
#define EVDEV_MAXBUTTONS 32
|
||||||
@@ -97,6 +97,8 @@
|
|||||||
/* Number of longs needed to hold the given number of bits */
|
/* Number of longs needed to hold the given number of bits */
|
||||||
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
||||||
|
|
||||||
|
#define DEFAULT_MOUSE_DPI 1000.0
|
||||||
|
|
||||||
/* Function key mode */
|
/* Function key mode */
|
||||||
enum fkeymode {
|
enum fkeymode {
|
||||||
FKEYMODE_UNKNOWN = 0,
|
FKEYMODE_UNKNOWN = 0,
|
||||||
@@ -129,42 +131,39 @@ typedef struct {
|
|||||||
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
|
EV_QUEUE_KEY, /* xf86PostKeyboardEvent() */
|
||||||
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
|
EV_QUEUE_BTN, /* xf86PostButtonEvent() */
|
||||||
EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
|
EV_QUEUE_PROXIMITY, /* xf86PostProximityEvent() */
|
||||||
#ifdef MULTITOUCH
|
|
||||||
EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
|
EV_QUEUE_TOUCH, /*xf86PostTouchEvent() */
|
||||||
#endif
|
|
||||||
} type;
|
} type;
|
||||||
union {
|
union {
|
||||||
int key; /* May be either a key code or button number. */
|
int key; /* May be either a key code or button number. */
|
||||||
#ifdef MULTITOUCH
|
|
||||||
unsigned int touch; /* Touch ID */
|
unsigned int touch; /* Touch ID */
|
||||||
#endif
|
|
||||||
} detail;
|
} detail;
|
||||||
int val; /* State of the key/button/touch; pressed or released. */
|
int val; /* State of the key/button/touch; pressed or released. */
|
||||||
#ifdef MULTITOUCH
|
|
||||||
ValuatorMask *touchMask;
|
ValuatorMask *touchMask;
|
||||||
#endif
|
|
||||||
} EventQueueRec, *EventQueuePtr;
|
} EventQueueRec, *EventQueuePtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
unsigned short id_vendor;
|
struct libevdev *dev;
|
||||||
unsigned short id_product;
|
|
||||||
|
|
||||||
char *device;
|
char *device;
|
||||||
int grabDevice; /* grab the event device? */
|
int grabDevice; /* grab the event device? */
|
||||||
|
|
||||||
int num_vals; /* number of valuators */
|
int num_vals; /* number of valuators */
|
||||||
int num_mt_vals; /* number of multitouch valuators */
|
int num_mt_vals; /* number of multitouch valuators */
|
||||||
int axis_map[max(ABS_CNT, REL_CNT)]; /* Map evdev <axis> to index */
|
int abs_axis_map[ABS_CNT]; /* Map evdev ABS_* to index */
|
||||||
ValuatorMask *vals; /* new values coming in */
|
int rel_axis_map[REL_CNT]; /* Map evdev REL_* to index */
|
||||||
ValuatorMask *old_vals; /* old values for calculating relative motion */
|
ValuatorMask *abs_vals; /* values for absolute axis */
|
||||||
ValuatorMask *prox; /* last values set while not in proximity */
|
ValuatorMask *rel_vals; /* values for relative axis */
|
||||||
|
ValuatorMask *old_vals; /* old absolute values for calculating relative motion */
|
||||||
|
ValuatorMask *prox; /* last absolute values set while not in proximity */
|
||||||
ValuatorMask *mt_mask;
|
ValuatorMask *mt_mask;
|
||||||
ValuatorMask **last_mt_vals;
|
ValuatorMask **last_mt_vals;
|
||||||
int cur_slot;
|
int cur_slot;
|
||||||
enum SlotState slot_state;
|
struct slot {
|
||||||
#ifdef MULTITOUCH
|
int dirty;
|
||||||
|
enum SlotState state;
|
||||||
|
} *slots;
|
||||||
struct mtdev *mtdev;
|
struct mtdev *mtdev;
|
||||||
#endif
|
BOOL fake_mt;
|
||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
int in_proximity; /* device in proximity */
|
int in_proximity; /* device in proximity */
|
||||||
@@ -173,13 +172,10 @@ typedef struct {
|
|||||||
BOOL swap_axes;
|
BOOL swap_axes;
|
||||||
BOOL invert_x;
|
BOOL invert_x;
|
||||||
BOOL invert_y;
|
BOOL invert_y;
|
||||||
|
int resolution;
|
||||||
|
|
||||||
int delta[REL_CNT];
|
|
||||||
unsigned int abs_queued, rel_queued, prox_queued;
|
unsigned int abs_queued, rel_queued, prox_queued;
|
||||||
|
|
||||||
/* XKB stuff has to be per-device rather than per-driver */
|
|
||||||
XkbRMLVOSet rmlvo;
|
|
||||||
|
|
||||||
/* Middle mouse button emulation */
|
/* Middle mouse button emulation */
|
||||||
struct {
|
struct {
|
||||||
BOOL enabled;
|
BOOL enabled;
|
||||||
@@ -198,7 +194,7 @@ typedef struct {
|
|||||||
int button; /* phys button to emit */
|
int button; /* phys button to emit */
|
||||||
int threshold; /* move threshold in dev coords */
|
int threshold; /* move threshold in dev coords */
|
||||||
OsTimerPtr timer;
|
OsTimerPtr timer;
|
||||||
int delta[2]; /* delta x/y, accumulating */
|
double delta[2]; /* delta x/y, accumulating */
|
||||||
int startpos[2]; /* starting pos for abs devices */
|
int startpos[2]; /* starting pos for abs devices */
|
||||||
int flags; /* remember if we had rel or abs movement */
|
int flags; /* remember if we had rel or abs movement */
|
||||||
} emulate3B;
|
} emulate3B;
|
||||||
@@ -218,6 +214,11 @@ typedef struct {
|
|||||||
Time expires; /* time of expiry */
|
Time expires; /* time of expiry */
|
||||||
Time timeout;
|
Time timeout;
|
||||||
} emulateWheel;
|
} emulateWheel;
|
||||||
|
struct {
|
||||||
|
int vert_delta;
|
||||||
|
int horiz_delta;
|
||||||
|
int dial_delta;
|
||||||
|
} smoothScroll;
|
||||||
/* run-time calibration */
|
/* run-time calibration */
|
||||||
struct {
|
struct {
|
||||||
int min_x;
|
int min_x;
|
||||||
@@ -232,15 +233,6 @@ typedef struct {
|
|||||||
int reopen_left; /* number of attempts left to re-open the device */
|
int reopen_left; /* number of attempts left to re-open the device */
|
||||||
OsTimerPtr reopen_timer;
|
OsTimerPtr reopen_timer;
|
||||||
|
|
||||||
/* Cached info from device. */
|
|
||||||
char name[1024];
|
|
||||||
unsigned long bitmask[NLONGS(EV_CNT)];
|
|
||||||
unsigned long key_bitmask[NLONGS(KEY_CNT)];
|
|
||||||
unsigned long rel_bitmask[NLONGS(REL_CNT)];
|
|
||||||
unsigned long abs_bitmask[NLONGS(ABS_CNT)];
|
|
||||||
unsigned long led_bitmask[NLONGS(LED_CNT)];
|
|
||||||
struct input_absinfo absinfo[ABS_CNT];
|
|
||||||
|
|
||||||
/* minor/major number */
|
/* minor/major number */
|
||||||
dev_t min_maj;
|
dev_t min_maj;
|
||||||
|
|
||||||
@@ -249,22 +241,20 @@ typedef struct {
|
|||||||
EventQueueRec queue[EVDEV_MAXQUEUE];
|
EventQueueRec queue[EVDEV_MAXQUEUE];
|
||||||
|
|
||||||
enum fkeymode fkeymode;
|
enum fkeymode fkeymode;
|
||||||
|
|
||||||
|
char *type_name;
|
||||||
} EvdevRec, *EvdevPtr;
|
} EvdevRec, *EvdevPtr;
|
||||||
|
|
||||||
/* Event posting functions */
|
/* Event posting functions */
|
||||||
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
void EvdevQueueKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value);
|
||||||
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
void EvdevQueueButtonEvent(InputInfoPtr pInfo, int button, int value);
|
||||||
void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
|
void EvdevQueueProximityEvent(InputInfoPtr pInfo, int value);
|
||||||
#ifdef MULTITOUCH
|
|
||||||
void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
|
void EvdevQueueTouchEvent(InputInfoPtr pInfo, unsigned int touch,
|
||||||
ValuatorMask *mask, uint16_t type);
|
ValuatorMask *mask, uint16_t type);
|
||||||
#endif
|
|
||||||
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
|
void EvdevPostButtonEvent(InputInfoPtr pInfo, int button, enum ButtonAction act);
|
||||||
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
|
void EvdevQueueButtonClicks(InputInfoPtr pInfo, int button, int count);
|
||||||
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo, int num_v, int first_v,
|
void EvdevPostRelativeMotionEvents(InputInfoPtr pInfo);
|
||||||
int v[MAX_VALUATORS]);
|
void EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo);
|
||||||
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 */
|
||||||
@@ -282,7 +272,7 @@ BOOL Evdev3BEmuFilterEvent(InputInfoPtr, int, BOOL);
|
|||||||
void Evdev3BEmuPreInit(InputInfoPtr pInfo);
|
void Evdev3BEmuPreInit(InputInfoPtr pInfo);
|
||||||
void Evdev3BEmuOn(InputInfoPtr);
|
void Evdev3BEmuOn(InputInfoPtr);
|
||||||
void Evdev3BEmuFinalize(InputInfoPtr);
|
void Evdev3BEmuFinalize(InputInfoPtr);
|
||||||
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy);
|
void Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy);
|
||||||
void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
|
void Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals);
|
||||||
|
|
||||||
/* Mouse Wheel emulation */
|
/* Mouse Wheel emulation */
|
||||||
|
|||||||
Reference in New Issue
Block a user