Compare commits

..

3 Commits

Author SHA1 Message Date
Peter Hutterer
51575b60b1 evdev 2.8.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-10-07 09:23:09 +11:00
Peter Hutterer
f285567d37 Write a SYN_REPORT after the last LED
When writing LED values to the device, append a SYN_REPORT to the list to
ensure other clients are updated immediately. Otherwise, the LED events
will be queued and not sent to other clients until the next input event
arrives.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
(cherry picked from commit 27926b3763)
2013-10-07 09:22:50 +11:00
Peter De Wachter
af1d085877 Map REL_DIAL to vertical scrolling
This makes the absolute axis codepath behave the same as the relative axis
path.

Signed-off-by: Peter De Wachter <pdewacht@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 54a3120e33)
2013-10-07 09:22:48 +11:00
8 changed files with 361 additions and 394 deletions

View File

@@ -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.8.2],
[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])
@@ -48,7 +48,6 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.10] xproto inputproto)
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(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])
if test "x$HAVE_XI22" = xyes; then if test "x$HAVE_XI22" = xyes; then
# Obtain compiler/linker options for mtdev # Obtain compiler/linker options for mtdev

View File

@@ -87,8 +87,4 @@
*/ */
#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

View File

@@ -226,18 +226,6 @@ 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 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 based on the device's capabilities. This option is provided for devices that
need quirks. 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".
.SH SUPPORTED PROPERTIES .SH SUPPORTED PROPERTIES
The following properties are provided by the The following properties are provided by the
@@ -278,9 +266,6 @@ 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

View File

@@ -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 $(LIBEVDEV_CFLAGS) AM_CPPFLAGS =-I$(top_srcdir)/include
@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) $(UDEV_LIBS) $(LIBEVDEV_LIBS) @DRIVER_NAME@_drv_la_LIBADD = $(MTDEV_LIBS) $(UDEV_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 \

View File

@@ -303,8 +303,7 @@ EvdevAppleInitProperty(DeviceIntPtr dev)
enum fkeymode fkeymode; enum fkeymode fkeymode;
if (!product_check(apple_keyboard_table, if (!product_check(apple_keyboard_table,
libevdev_get_id_vendor(pEvdev->dev), pEvdev->id_vendor, pEvdev->id_product))
libevdev_get_id_product(pEvdev->dev)))
return; return;
fkeymode = get_fnmode(); fkeymode = get_fnmode();

View File

@@ -97,6 +97,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)
@@ -114,15 +115,12 @@ 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->abs_axis_map[pEv->code]; int axis = pEvdev->abs_axis_map[pEv->code];
int oldValue; oldValue = valuator_mask_get(pEvdev->vals, axis);
valuator_mask_set(pEvdev->vals, axis, value);
if (axis > -1 && valuator_mask_fetch(pEvdev->old_vals, axis, &oldValue)) { value -= oldValue; /* make value into a differential measurement */
valuator_mask_set(pEvdev->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) {

File diff suppressed because it is too large Load Diff

View File

@@ -47,8 +47,6 @@
#include <mtdev.h> #include <mtdev.h>
#endif #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)
#endif #endif
@@ -152,7 +150,8 @@ typedef struct {
} EventQueueRec, *EventQueuePtr; } EventQueueRec, *EventQueuePtr;
typedef struct { typedef struct {
struct libevdev *dev; unsigned short id_vendor;
unsigned short id_product;
char *device; char *device;
int grabDevice; /* grab the event device? */ int grabDevice; /* grab the event device? */
@@ -221,11 +220,6 @@ 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;
@@ -240,6 +234,13 @@ 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. */
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)];
struct input_absinfo absinfo[ABS_CNT];
/* minor/major number */ /* minor/major number */
dev_t min_maj; dev_t min_maj;