Compare commits

..

7 Commits

Author SHA1 Message Date
Peter Hutterer
8a9b1ec6b5 evdev 2.8.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-07-11 11:09:24 +10:00
Peter Hutterer
356565111a Don't allow a wheel emulation inertia of 0 (#66125)
Inertia of 0 results in an infinite loop of events being sent to the server.

X.Org Bug 66125 <http://bugs.freedesktop.org/show_bug.cgi?id=66125>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-06-27 06:58:27 +10:00
Peter Hutterer
fff3a60fbf Use EvdevBitIsSet, not the server's BitIsOn
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-31 06:57:22 +10:00
Peter Hutterer
8f209ac60d Drop cached name and led_bitmask - nothing reads this
Both fields are write-only as of xf86-input-evdev-2.5.99.902-1-g1ced7ec

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-05-31 06:57:22 +10:00
Peter Hutterer
a0d41af896 Switch default model to pc104.
As of xkeyboard-config 1.9, the evdev model is hidden (c887d2876)
The server switched to pc105 with version 1.8 (1df4bd601).

The evdev model resolves to pc104 anyway, so this commit has no real effect
other than to switch from a catch-all rule to explicit.
Use pc104 so this is easy to find for those investigating the code and
wondering why. pc104 is the 'correct' geometry for the us layout, which is
the default after all. Switching to pc105 would show keys missing if no
model is set (e.g. on uk/de layouts) but it would be the wrong layout for
the default.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
2013-05-31 06:57:16 +10:00
Peter Hutterer
dea1d1a390 Fail to set up axes for devices that only have MT axes but no ABS_X/Y equivalents (#64029)
The kernel should give us ABS_X/Y for backwards compat but some devices
don't. For now, ignore these devices as evdev is not suited to handle this
yet and will crash if a device is set up without axes (i.e.
pEvdev->vals == NULL) and later receives an event from an MT axis.

X.Org Bug 64029 <http://bugs.freedesktop.org/show_bug.cgi?id=64029>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
2013-05-01 15:05:43 +10:00
Peter Hutterer
b59a1a25da Add option TypeName (#62831)
evdev tries to assign the right XI 1.x type-name based on various device
capabilities. In some cases, that fails. e.g. the Mionix Naos 5000 mouse
looks like a keyboard. And we assign a keyboard type in that case since
there are plenty of keyboards that also advertise some axes or others.

Add a new option TypeName to allow for system-wide configuration of such
devices in a quirks file.

This can also be used to address #55867

X.Org Bug 62831 <http://bugs.freedesktop.org/show_bug.cgi?id=62831>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-04-16 10:25:02 +10:00
5 changed files with 34 additions and 24 deletions

View File

@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-input-evdev],
[2.8.0],
[2.8.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-input-evdev])
AC_CONFIG_SRCDIR([Makefile.am])

View File

@@ -220,6 +220,12 @@ is mapped to the negative Y axis motion and button number
.I N2
is mapped to the positive Y axis motion. Default: "4 5". Property:
"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.
.SH SUPPORTED PROPERTIES
The following properties are provided by the

View File

@@ -392,7 +392,7 @@ EvdevWheelEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val,
inertia = *((CARD16*)val->data);
if (inertia < 0)
if (inertia <= 0)
return BadValue;
if (!checkonly)

View File

@@ -96,7 +96,7 @@
static const char *evdevDefaults[] = {
"XkbRules", "evdev",
"XkbModel", "evdev",
"XkbModel", "pc104", /* the right model for 'us' */
"XkbLayout", "us",
NULL
};
@@ -1267,7 +1267,7 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
for (j = 0; j < ArrayLength(mt_axis_mappings); j++)
{
if (mt_axis_mappings[j].mt_code == axis &&
BitIsOn(pEvdev->abs_bitmask, mt_axis_mappings[j].code))
EvdevBitIsSet(pEvdev->abs_bitmask, mt_axis_mappings[j].code))
{
mt_axis_mappings[j].needs_mapping = TRUE;
skip = TRUE;
@@ -1283,6 +1283,15 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
num_axes--;
}
}
/* device only has mt-axes. the kernel should give us ABS_X etc for
backwards compat but some devices don't have it. */
if (num_axes == 0 && num_mt_axes > 0) {
xf86IDrvMsg(pInfo, X_ERROR,
"found only multitouch-axes. That shouldn't happen.\n");
goto out;
}
#endif
#ifdef HAVE_SMOOTH_SCROLLING
@@ -1974,12 +1983,10 @@ EvdevCache(InputInfoPtr pInfo)
int i, len;
struct input_id id;
char name[1024] = {0};
unsigned long bitmask[NLONGS(EV_CNT)] = {0};
unsigned long key_bitmask[NLONGS(KEY_CNT)] = {0};
unsigned long rel_bitmask[NLONGS(REL_CNT)] = {0};
unsigned long abs_bitmask[NLONGS(ABS_CNT)] = {0};
unsigned long led_bitmask[NLONGS(LED_CNT)] = {0};
if (ioctl(pInfo->fd, EVIOCGID, &id) < 0)
@@ -1991,13 +1998,6 @@ EvdevCache(InputInfoPtr pInfo)
pEvdev->id_vendor = id.vendor;
pEvdev->id_product = id.product;
if (ioctl(pInfo->fd, EVIOCGNAME(sizeof(name) - 1), name) < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGNAME failed: %s\n", strerror(errno));
goto error;
}
strcpy(pEvdev->name, name);
len = ioctl(pInfo->fd, EVIOCGBIT(0, sizeof(bitmask)), bitmask);
if (len < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT for bitmask failed: %s\n",
@@ -2025,15 +2025,6 @@ EvdevCache(InputInfoPtr pInfo)
memcpy(pEvdev->abs_bitmask, abs_bitmask, len);
len = ioctl(pInfo->fd, EVIOCGBIT(EV_LED, sizeof(led_bitmask)), led_bitmask);
if (len < 0) {
xf86IDrvMsg(pInfo, X_ERROR, "ioctl EVIOCGBIT for EV_LED failed: %s\n",
strerror(errno));
goto error;
}
memcpy(pEvdev->led_bitmask, led_bitmask, len);
/*
* Do not try to validate absinfo data since it is not expected
* to be static, always refresh it in evdev structure.
@@ -2548,6 +2539,9 @@ EvdevUnInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
/* Release string allocated in EvdevOpenDevice. */
free(pEvdev->device);
pEvdev->device = NULL;
free(pEvdev->type_name);
pEvdev->type_name = NULL;
}
xf86DeleteInput(pInfo, flags);
}
@@ -2579,6 +2573,8 @@ EvdevAlloc(void)
pEvdev->rel_axis_map[0] = 0;
pEvdev->rel_axis_map[1] = 1;
pEvdev->type_name = NULL;
return pEvdev;
}
@@ -2623,6 +2619,14 @@ EvdevPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
goto error;
}
/* Overwrite type_name with custom-defined one (#62831).
Note: pInfo->type_name isn't freed so we need to manually do this
*/
pEvdev->type_name = xf86SetStrOption(pInfo->options,
"TypeName",
pInfo->type_name);
pInfo->type_name = pEvdev->type_name;
EvdevAddDevice(pInfo);
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)

View File

@@ -235,12 +235,10 @@ typedef struct {
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 */
@@ -251,6 +249,8 @@ typedef struct {
EventQueueRec queue[EVDEV_MAXQUEUE];
enum fkeymode fkeymode;
char *type_name;
} EvdevRec, *EvdevPtr;
/* Event posting functions */