mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
40 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
551db5b86e | ||
|
|
bb8bde7456 | ||
|
|
7b1267f7f1 | ||
|
|
e08b033276 | ||
|
|
7c1971d9e7 | ||
|
|
9a6952dafe | ||
|
|
f12eca9f83 | ||
|
|
33dc3d7128 | ||
|
|
7b0a65d989 | ||
|
|
d24431a186 | ||
|
|
ce7d8fdebc | ||
|
|
6a3beab613 | ||
|
|
d7e61a7074 | ||
|
|
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 |
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
|
||||||
|
|
||||||
|
|||||||
21
configure.ac
21
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.9.0],
|
[2.10.4],
|
||||||
[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])
|
||||||
@@ -44,19 +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(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`
|
||||||
|
|||||||
@@ -125,6 +125,19 @@ Property: "Evdev Wheel Emulation Button".
|
|||||||
Specifies how far (in pixels) the pointer must move to generate button
|
Specifies how far (in pixels) the pointer must move to generate button
|
||||||
press/release events in wheel emulation mode. Default: 10. Property: "Evdev
|
press/release events in wheel emulation mode. Default: 10. Property: "Evdev
|
||||||
Wheel Emulation Inertia".
|
Wheel Emulation Inertia".
|
||||||
|
.IP
|
||||||
|
This value must be set for any device does not resemble a standard mouse.
|
||||||
|
Specifically, on absolute devices such as tablets the value should be set to
|
||||||
|
a reasonable fraction of the expected movement to avoid excess scroll events.
|
||||||
|
.IP
|
||||||
|
.B WARNING:
|
||||||
|
the name \*qinertia\*q is a misnomer. This option defines the distance
|
||||||
|
required to generate one scroll event similar to the
|
||||||
|
.B VertScrollDelta
|
||||||
|
and
|
||||||
|
.B HorizScrollDelta
|
||||||
|
options. It does not enable inertia in the
|
||||||
|
physical sense, scrolling stops immediately once the movement has stopped.
|
||||||
.TP 7
|
.TP 7
|
||||||
.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
|
.BI "Option \*qEmulateWheelTimeout\*q \*q" integer \*q
|
||||||
Specifies the time in milliseconds the
|
Specifies the time in milliseconds the
|
||||||
@@ -238,6 +251,12 @@ Default: "1". Property: "Evdev Scrolling Distance".
|
|||||||
.BI "Option \*qDialDelta\*q \*q" integer \*q
|
.BI "Option \*qDialDelta\*q \*q" integer \*q
|
||||||
The amount of motion considered one unit of turning the dial. Default: "1".
|
The amount of motion considered one unit of turning the dial. Default: "1".
|
||||||
Property: "Evdev Scrolling Distance".
|
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
|
||||||
|
|||||||
21
src/emuMB.c
21
src/emuMB.c
@@ -184,10 +184,13 @@ int
|
|||||||
EvdevMBEmuTimer(InputInfoPtr pInfo)
|
EvdevMBEmuTimer(InputInfoPtr pInfo)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
int sigstate;
|
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
sigstate = xf86BlockSIGIO ();
|
#if HAVE_THREADED_INPUT
|
||||||
|
input_lock();
|
||||||
|
#else
|
||||||
|
int sigstate = xf86BlockSIGIO();
|
||||||
|
#endif
|
||||||
|
|
||||||
pEvdev->emulateMB.pending = FALSE;
|
pEvdev->emulateMB.pending = FALSE;
|
||||||
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
if ((id = stateTab[pEvdev->emulateMB.state][4][0]) != 0) {
|
||||||
@@ -200,7 +203,11 @@ EvdevMBEmuTimer(InputInfoPtr pInfo)
|
|||||||
pEvdev->emulateMB.state);
|
pEvdev->emulateMB.state);
|
||||||
}
|
}
|
||||||
|
|
||||||
xf86UnblockSIGIO (sigstate);
|
#if HAVE_THREADED_INPUT
|
||||||
|
input_unlock();
|
||||||
|
#else
|
||||||
|
xf86UnblockSIGIO(sigstate);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,9 +268,7 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EvdevMBEmuWakeupHandler(pointer data,
|
void EvdevMBEmuWakeupHandler(WAKEUP_HANDLER_ARGS)
|
||||||
int i,
|
|
||||||
pointer LastSelectMask)
|
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo = (InputInfoPtr)data;
|
InputInfoPtr pInfo = (InputInfoPtr)data;
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
@@ -277,9 +282,7 @@ void EvdevMBEmuWakeupHandler(pointer data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EvdevMBEmuBlockHandler(pointer data,
|
void EvdevMBEmuBlockHandler(BLOCK_HANDLER_ARGS)
|
||||||
struct timeval **waitTime,
|
|
||||||
pointer LastSelectMask)
|
|
||||||
{
|
{
|
||||||
InputInfoPtr pInfo = (InputInfoPtr) data;
|
InputInfoPtr pInfo = (InputInfoPtr) data;
|
||||||
EvdevPtr pEvdev= (EvdevPtr) pInfo->private;
|
EvdevPtr pEvdev= (EvdevPtr) pInfo->private;
|
||||||
|
|||||||
@@ -89,12 +89,19 @@ Evdev3BEmuTimer(OsTimerPtr timer, CARD32 time, pointer arg)
|
|||||||
InputInfoPtr pInfo = (InputInfoPtr)arg;
|
InputInfoPtr pInfo = (InputInfoPtr)arg;
|
||||||
EvdevPtr pEvdev = pInfo->private;
|
EvdevPtr pEvdev = pInfo->private;
|
||||||
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
struct emulate3B *emu3B = &pEvdev->emulate3B;
|
||||||
int sigstate = 0;
|
|
||||||
|
|
||||||
sigstate = xf86BlockSIGIO ();
|
#if HAVE_THREADED_INPUT
|
||||||
|
input_lock();
|
||||||
|
#else
|
||||||
|
int sigstate = xf86BlockSIGIO();
|
||||||
|
#endif
|
||||||
emu3B->state = EM3B_EMULATING;
|
emu3B->state = EM3B_EMULATING;
|
||||||
Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
|
Evdev3BEmuPostButtonEvent(pInfo, emu3B->button, BUTTON_PRESS);
|
||||||
xf86UnblockSIGIO (sigstate);
|
#if HAVE_THREADED_INPUT
|
||||||
|
input_unlock();
|
||||||
|
#else
|
||||||
|
xf86UnblockSIGIO(sigstate);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,8 +236,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 +255,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 +267,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);
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ BOOL
|
|||||||
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
||||||
{
|
{
|
||||||
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
EvdevPtr pEvdev = (EvdevPtr)pInfo->private;
|
||||||
WheelAxisPtr pAxis = NULL, pOtherAxis = NULL;
|
WheelAxisPtr pAxis = NULL;
|
||||||
int value = pEv->value;
|
int value = pEv->value;
|
||||||
|
|
||||||
/* Has wheel emulation been configured to be enabled? */
|
/* Has wheel emulation been configured to be enabled? */
|
||||||
@@ -119,7 +119,7 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
int oldValue;
|
int oldValue;
|
||||||
|
|
||||||
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
|
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) {
|
||||||
valuator_mask_set(pEvdev->vals, axis, value);
|
valuator_mask_set(pEvdev->abs_vals, axis, value);
|
||||||
value -= oldValue; /* make value into a differential measurement */
|
value -= oldValue; /* make value into a differential measurement */
|
||||||
} else
|
} else
|
||||||
value = 0; /* avoid a jump on the first touch */
|
value = 0; /* avoid a jump on the first touch */
|
||||||
@@ -130,13 +130,11 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
/* ABS_X has the same value as REL_X, so this case catches both */
|
/* ABS_X has the same value as REL_X, so this case catches both */
|
||||||
case REL_X:
|
case REL_X:
|
||||||
pAxis = &(pEvdev->emulateWheel.X);
|
pAxis = &(pEvdev->emulateWheel.X);
|
||||||
pOtherAxis = &(pEvdev->emulateWheel.Y);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* ABS_Y has the same value as REL_Y, so this case catches both */
|
/* ABS_Y has the same value as REL_Y, so this case catches both */
|
||||||
case REL_Y:
|
case REL_Y:
|
||||||
pAxis = &(pEvdev->emulateWheel.Y);
|
pAxis = &(pEvdev->emulateWheel.Y);
|
||||||
pOtherAxis = &(pEvdev->emulateWheel.X);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -144,15 +142,10 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
/* If we found REL_X, REL_Y, ABS_X or ABS_Y then emulate a mouse
|
||||||
wheel. Reset the inertia of the other axis when a scroll event
|
wheel.
|
||||||
was sent to avoid the buildup of erroneous scroll events if the
|
|
||||||
user doesn't move in a perfectly straight line.
|
|
||||||
*/
|
*/
|
||||||
if (pAxis)
|
if (pAxis)
|
||||||
{
|
EvdevWheelEmuInertia(pInfo, pAxis, value);
|
||||||
if (EvdevWheelEmuInertia(pInfo, pAxis, value))
|
|
||||||
pOtherAxis->traveled_distance = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Eat motion events while emulateWheel button pressed. */
|
/* Eat motion events while emulateWheel button pressed. */
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|||||||
705
src/evdev.c
705
src/evdev.c
File diff suppressed because it is too large
Load Diff
59
src/evdev.h
59
src/evdev.h
@@ -43,9 +43,7 @@
|
|||||||
#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>
|
#include <libevdev/libevdev.h>
|
||||||
|
|
||||||
@@ -65,14 +63,22 @@
|
|||||||
#define LED_CNT (LED_MAX+1)
|
#define LED_CNT (LED_MAX+1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 14
|
|
||||||
#define HAVE_SMOOTH_SCROLLING 1
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18
|
||||||
#define LogMessageVerbSigSafe xf86MsgVerb
|
#define LogMessageVerbSigSafe xf86MsgVerb
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23
|
||||||
|
#define HAVE_THREADED_INPUT 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 24
|
||||||
|
#define BLOCK_HANDLER_ARGS void *data, void *waitTime
|
||||||
|
#define WAKEUP_HANDLER_ARGS void *data, int i
|
||||||
|
#else
|
||||||
|
#define BLOCK_HANDLER_ARGS pointer data, struct timeval **waitTime, pointer LastSelectMask
|
||||||
|
#define WAKEUP_HANDLER_ARGS void *data, int i, pointer LastSelectMask
|
||||||
|
#endif
|
||||||
|
|
||||||
#define EVDEV_MAXBUTTONS 32
|
#define EVDEV_MAXBUTTONS 32
|
||||||
#define EVDEV_MAXQUEUE 32
|
#define EVDEV_MAXQUEUE 32
|
||||||
|
|
||||||
@@ -103,6 +109,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,
|
||||||
@@ -135,20 +143,14 @@ 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 {
|
||||||
@@ -161,16 +163,19 @@ typedef struct {
|
|||||||
int num_mt_vals; /* number of multitouch valuators */
|
int num_mt_vals; /* number of multitouch valuators */
|
||||||
int abs_axis_map[ABS_CNT]; /* Map evdev ABS_* to index */
|
int abs_axis_map[ABS_CNT]; /* Map evdev ABS_* to index */
|
||||||
int rel_axis_map[REL_CNT]; /* Map evdev REL_* to index */
|
int rel_axis_map[REL_CNT]; /* Map evdev REL_* to index */
|
||||||
ValuatorMask *vals; /* new values coming in */
|
ValuatorMask *abs_vals; /* values for absolute axis */
|
||||||
ValuatorMask *old_vals; /* old values for calculating relative motion */
|
ValuatorMask *rel_vals; /* values for relative axis */
|
||||||
ValuatorMask *prox; /* last values set while not in proximity */
|
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 */
|
||||||
@@ -179,8 +184,8 @@ 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;
|
||||||
|
|
||||||
/* Middle mouse button emulation */
|
/* Middle mouse button emulation */
|
||||||
@@ -201,7 +206,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;
|
||||||
@@ -256,23 +261,19 @@ typedef struct {
|
|||||||
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 */
|
||||||
int EvdevMBEmuTimer(InputInfoPtr);
|
int EvdevMBEmuTimer(InputInfoPtr);
|
||||||
BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
|
BOOL EvdevMBEmuFilterEvent(InputInfoPtr, int, BOOL);
|
||||||
void EvdevMBEmuWakeupHandler(pointer, int, pointer);
|
void EvdevMBEmuWakeupHandler(WAKEUP_HANDLER_ARGS);
|
||||||
void EvdevMBEmuBlockHandler(pointer, struct timeval**, pointer);
|
void EvdevMBEmuBlockHandler(BLOCK_HANDLER_ARGS);
|
||||||
void EvdevMBEmuPreInit(InputInfoPtr);
|
void EvdevMBEmuPreInit(InputInfoPtr);
|
||||||
void EvdevMBEmuOn(InputInfoPtr);
|
void EvdevMBEmuOn(InputInfoPtr);
|
||||||
void EvdevMBEmuFinalize(InputInfoPtr);
|
void EvdevMBEmuFinalize(InputInfoPtr);
|
||||||
@@ -283,7 +284,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