mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
7 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed1382866c | ||
|
|
8fe38b2287 | ||
|
|
ef607b6cce | ||
|
|
906a5d6add | ||
|
|
5152d616ca | ||
|
|
2e9a71df5f | ||
|
|
49de32e70f |
@@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-input-evdev],
|
||||
2.0.2,
|
||||
2.0.4,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-input-evdev)
|
||||
|
||||
|
||||
30
src/evdev.c
30
src/evdev.c
@@ -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;
|
||||
}
|
||||
|
||||
@@ -305,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)
|
||||
@@ -861,6 +874,7 @@ EvdevProc(DeviceIntPtr device, int what)
|
||||
|
||||
case DEVICE_CLOSE:
|
||||
xf86Msg(X_INFO, "%s: Close\n", pInfo->name);
|
||||
close(pInfo->fd);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -894,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;
|
||||
|
||||
@@ -1101,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,
|
||||
|
||||
Reference in New Issue
Block a user