Compare commits

..

12 Commits

Author SHA1 Message Date
Peter Hutterer
ed1382866c evdev 2.0.4 2008-08-14 23:17:16 +09:30
Adam Jackson
8fe38b2287 Print a warning if a keycode exceeds the range accepted by the server.
Keycodes over 255 are silently ignored in the server. The least we can do is
put a warning in the logs.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit c1f7f8c3d2)
2008-08-07 10:40:14 +09:30
Julien Cristau
ef607b6cce Actually close the fd on DEVICE_CLOSE (bug#16948)
Fixes file descriptor leak.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit d9097df01b)
2008-08-04 09:25:27 +09:30
Julien Cristau
906a5d6add Print the device name when we get a read error
(cherry picked from commit 5c074af5a9)
2008-08-04 09:25:14 +09:30
Peter Hutterer
5152d616ca evdev 2.0.3 2008-08-01 17:29:24 +09:30
Michel Dänzer
2e9a71df5f xf86-input-evdev: Fix EVIOCGBIT ioctl usage on big endian platforms.
With this fix, on my PowerBook HAL hotplugging correctly detects my USB mouse,
and no longer thinks keyboards have random numbers of mouse buttons. :)

The LONG_BITS and NBITS macro definitions are stolen from xf86-input-synaptics.

Signed-off-by: Michel Dänzer <michel@tungstengraphics.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
[cherry-picked from master and fixed the trivial conflict -- jcristau]
2008-07-30 10:45:31 +02:00
Julien Cristau
49de32e70f Fill up the version info
Report correct versions instead of
"compiled for 0.0.0, module version = 1.0.0"
(cherry picked from commit 2b7edaa4ab)
2008-07-20 11:45:30 +02:00
Peter Hutterer
f135e07462 evdev 2.0.2 2008-07-14 13:34:36 +09:30
Peter Hutterer
e926356eb0 Don't enable the device if the grab failed with ENODEV.
After suspend/resume, sometimes the device doesn't come back up on the same
node. Since we do not call PreInit for the device (which would detect this
situation), we continue to try to read a nonexisting file, spamming the log
file with "Read Error".
(cherry picked from commit bf0d81011e)
2008-07-14 13:17:39 +09:30
Peter Hutterer
bd56ab3d72 Add .gitignore file.
(cherry picked from commit ef4bb69c1a)
2008-07-10 19:34:05 +09:30
Peter Hutterer
2b30413598 Remove static ChangeLog, autogenerate as part of make dist.
Hook taken from xserver's Makefile.am
(cherry picked from commit ec23c6b2f5)
2008-07-10 19:29:57 +09:30
Ander Conselvan de Oliveira
52fc8ee846 Mice with a lot of buttons (e.g. Logitech MX1000) generate button events greater than BTN_TASK.
Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
(cherry picked from commit 0830676a0c)
2008-07-10 19:29:45 +09:30
5 changed files with 77 additions and 62 deletions

26
.gitignore vendored Normal file
View File

@@ -0,0 +1,26 @@
*.patch
ChangeLog
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.guess
config.h
config.h.in
config.log
config.status
config.sub
configure
depcomp
install-sh
libtool
ltmain.sh
man/evdev.4
missing
.deps
.libs
*.lo
*.la
stamp-h1
*.bz2
*.gz

View File

@@ -1,47 +0,0 @@
2006-01-09 David Nusinow,,, <set EMAIL_ADDRESS environment variable>
* man/Makefile.am:
* man/evdev.man:
Bugzilla #968 <https://bugs.freedesktop.org/show_bug.cgi?id=968>
Patch #4301 <https://bugs.freedesktop.org/attachment.cgi?id=4301>
Add evdev manpage
2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version for X11R7 release.
2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for final X11R7 release candidate.
2005-12-06 Kevin E. Martin <kem-at-freedesktop-dot-org>
* man/Makefile.am:
Change *man_SOURCES ==> *man_PRE to fix autotools warnings.
2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for X11R7 RC3 release.
2005-12-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Remove extraneous AC_MSG_RESULT.
2005-11-29 Adam Jackson <ajax@freedesktop.org>
* configure.ac:
Only build dlloader modules by default.
2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update package version number for X11R7 RC2 release.
2005-11-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
* configure.ac:
Update pkgcheck dependencies to work with separate build roots.

View File

@@ -20,3 +20,15 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src man
EXTRA_DIST = ChangeLog autogen.sh
MAINTAINERCLEANFILES=ChangeLog
.PHONY: ChangeLog
ChangeLog:
(GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || \
(touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
dist-hook: ChangeLog

View File

@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-input-evdev],
2.0.1,
2.0.4,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-input-evdev)

View File

@@ -42,6 +42,7 @@
#include <xf86Xinput.h>
#include <exevents.h>
#include <mipointer.h>
#include <xorgVersion.h>
#include "evdev.h"
@@ -130,6 +131,9 @@ PostButtonClicks(InputInfoPtr pInfo, int button, int count)
static void
PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
{
int code = ev->code + MIN_KEYCODE;
static char warned[KEY_MAX];
/* filter repeat events for chording keys */
if (value == 2 &&
(ev->code == KEY_LEFTCTRL || ev->code == KEY_RIGHTCTRL ||
@@ -140,7 +144,14 @@ PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
ev->code == KEY_SCROLLLOCK)) /* XXX windows keys? */
return;
xf86PostKeyboardEvent(pInfo->dev, ev->code + MIN_KEYCODE, value);
if (code > 255 && ev->code < KEY_MAX) {
if (!warned[ev->code])
xf86Msg(X_WARNING, "%s: unable to handle keycode %d\n",
pInfo->name, ev->code);
warned[ev->code] = 1;
}
xf86PostKeyboardEvent(pInfo->dev, code, value);
}
static void
@@ -161,7 +172,7 @@ EvdevReadInput(InputInfoPtr pInfo)
if (len != sizeof ev) {
/* The kernel promises that we always only read a complete
* event, so len != sizeof ev is an error. */
xf86Msg(X_ERROR, "Read error: %s\n", strerror(errno));
xf86Msg(X_ERROR, "%s: Read error: %s\n", pInfo->name, strerror(errno));
break;
}
@@ -252,8 +263,15 @@ EvdevReadInput(InputInfoPtr pInfo)
break;
default:
if (ev.code > BTN_TASK && ev.code < KEY_OK)
if (ev.code > BTN_TASK && ev.code < KEY_OK) {
/* Some fancy mice with a lot of buttons generate
* button events between BTN_TASK and BTN_JOYSTICK */
if (ev.code < BTN_JOYSTICK)
xf86PostButtonEvent(pInfo->dev, 0,
ev.code - BTN_LEFT + 5,
value, 0, 0);
break;
}
PostKbdEvent(pInfo, &ev, value);
break;
@@ -298,7 +316,9 @@ EvdevReadInput(InputInfoPtr pInfo)
}
}
#define TestBit(bit, array) (array[(bit) / 8] & (1 << ((bit) % 8)))
#define LONG_BITS (sizeof(long) * 8)
#define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
#define TestBit(bit, array) (array[(bit) / LONG_BITS]) & (1 << ((bit) % LONG_BITS))
static void
EvdevPtrCtrlProc(DeviceIntPtr device, PtrCtrl *ctrl)
@@ -834,12 +854,15 @@ EvdevProc(DeviceIntPtr device, int what)
if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)1))
xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name,
strerror(errno));
xf86AddEnabledDevice(pInfo);
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
EvdevMBEmuPreInit(pInfo);
device->public.on = TRUE;
if (errno != ENODEV)
{
xf86AddEnabledDevice(pInfo);
if (pEvdev->flags & EVDEV_BUTTON_EVENTS)
EvdevMBEmuPreInit(pInfo);
device->public.on = TRUE;
}
break;
case DEVICE_OFF:
if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)0))
xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name,
@@ -851,6 +874,7 @@ EvdevProc(DeviceIntPtr device, int what)
case DEVICE_CLOSE:
xf86Msg(X_INFO, "%s: Close\n", pInfo->name);
close(pInfo->fd);
break;
}
@@ -884,9 +908,9 @@ EvdevConvert(InputInfoPtr pInfo, int first, int num, int v0, int v1, int v2,
static int
EvdevProbe(InputInfoPtr pInfo)
{
char key_bitmask[(KEY_MAX + 7) / 8];
char rel_bitmask[(REL_MAX + 7) / 8];
char abs_bitmask[(ABS_MAX + 7) / 8];
long key_bitmask[NBITS(KEY_MAX)];
long rel_bitmask[NBITS(REL_MAX)];
long abs_bitmask[NBITS(ABS_MAX)];
int i, has_axes, has_buttons, has_keys;
EvdevPtr pEvdev = pInfo->private;
@@ -1091,8 +1115,8 @@ static XF86ModuleVersionInfo EvdevVersionRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
0, /* Missing from SDK: XORG_VERSION_CURRENT, */
1, 0, 0,
XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
MOD_CLASS_XINPUT,