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 | |
|---|---|---|---|
|
|
11d506dce6 | ||
|
|
a34a2cd347 | ||
|
|
78c00bd77f | ||
|
|
760f1c6bb1 | ||
|
|
2db04ba3c3 | ||
|
|
363d0bdb9f | ||
|
|
16a26a1eca |
@@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-input-evdev],
|
||||
2.1.0,
|
||||
2.1.1,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-input-evdev)
|
||||
|
||||
|
||||
@@ -201,5 +201,5 @@ server, such as touchscreens that require run-time calibration.
|
||||
.SH AUTHORS
|
||||
Kristian Høgsberg.
|
||||
.SH "SEE ALSO"
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
|
||||
__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__),
|
||||
README.mouse.
|
||||
|
||||
@@ -231,6 +231,11 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press)
|
||||
if (!pEvdev->emulateMB.enabled)
|
||||
return ret;
|
||||
|
||||
if (button == 2) {
|
||||
EvdevMBEmuEnable(pInfo, FALSE);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* don't care about other buttons */
|
||||
if (button != 1 && button != 3)
|
||||
return ret;
|
||||
|
||||
28
src/evdev.c
28
src/evdev.c
@@ -236,7 +236,7 @@ static void
|
||||
PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||
{
|
||||
int code = ev->code + MIN_KEYCODE;
|
||||
static char warned[KEY_MAX];
|
||||
static char warned[KEY_CNT];
|
||||
|
||||
/* filter repeat events for chording keys */
|
||||
if (value == 2 &&
|
||||
@@ -248,7 +248,7 @@ PostKbdEvent(InputInfoPtr pInfo, struct input_event *ev, int value)
|
||||
ev->code == KEY_SCROLLLOCK)) /* XXX windows keys? */
|
||||
return;
|
||||
|
||||
if (code > 255 && ev->code < KEY_MAX) {
|
||||
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);
|
||||
@@ -854,7 +854,7 @@ EvdevAddKeyClass(DeviceIntPtr device)
|
||||
SetXkbOption(pInfo, "xkb_rules", &pEvdev->xkb_rules);
|
||||
SetXkbOption(pInfo, "xkb_model", &pEvdev->xkb_model);
|
||||
if (!pEvdev->xkb_model)
|
||||
SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_rules);
|
||||
SetXkbOption(pInfo, "XkbModel", &pEvdev->xkb_model);
|
||||
SetXkbOption(pInfo, "xkb_layout", &pEvdev->xkb_layout);
|
||||
if (!pEvdev->xkb_layout)
|
||||
SetXkbOption(pInfo, "XkbLayout", &pEvdev->xkb_layout);
|
||||
@@ -1150,6 +1150,8 @@ EvdevProc(DeviceIntPtr device, int what)
|
||||
return EvdevOn(device);
|
||||
|
||||
case DEVICE_OFF:
|
||||
if (pEvdev->flags & EVDEV_INITIALIZED)
|
||||
EvdevMBEmuFinalize(pInfo);
|
||||
if (pInfo->fd != -1)
|
||||
{
|
||||
if (pEvdev->grabDevice && ioctl(pInfo->fd, EVIOCGRAB, (void *)0))
|
||||
@@ -1200,12 +1202,12 @@ EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
|
||||
int i;
|
||||
|
||||
char name[1024] = {0};
|
||||
long bitmask[NBITS(EV_MAX)] = {0};
|
||||
long key_bitmask[NBITS(KEY_MAX)] = {0};
|
||||
long rel_bitmask[NBITS(REL_MAX)] = {0};
|
||||
long abs_bitmask[NBITS(ABS_MAX)] = {0};
|
||||
long led_bitmask[NBITS(LED_MAX)] = {0};
|
||||
struct input_absinfo absinfo[ABS_MAX];
|
||||
long bitmask[NLONGS(EV_CNT)] = {0};
|
||||
long key_bitmask[NLONGS(KEY_CNT)] = {0};
|
||||
long rel_bitmask[NLONGS(REL_CNT)] = {0};
|
||||
long abs_bitmask[NLONGS(ABS_CNT)] = {0};
|
||||
long led_bitmask[NLONGS(LED_CNT)] = {0};
|
||||
struct input_absinfo absinfo[ABS_CNT];
|
||||
|
||||
if (ioctl(pInfo->fd,
|
||||
EVIOCGNAME(sizeof(name) - 1), name) < 0) {
|
||||
@@ -1264,7 +1266,7 @@ EvdevCacheCompare(InputInfoPtr pInfo, BOOL compare)
|
||||
|
||||
memset(absinfo, 0, sizeof(absinfo));
|
||||
|
||||
for (i = 0; i < ABS_MAX; i++)
|
||||
for (i = ABS_X; i <= ABS_MAX; i++)
|
||||
{
|
||||
if (TestBit(i, abs_bitmask))
|
||||
{
|
||||
@@ -1300,9 +1302,9 @@ error:
|
||||
static int
|
||||
EvdevProbe(InputInfoPtr pInfo)
|
||||
{
|
||||
long key_bitmask[NBITS(KEY_MAX)] = {0};
|
||||
long rel_bitmask[NBITS(REL_MAX)] = {0};
|
||||
long abs_bitmask[NBITS(ABS_MAX)] = {0};
|
||||
long key_bitmask[NLONGS(KEY_CNT)] = {0};
|
||||
long rel_bitmask[NLONGS(REL_CNT)] = {0};
|
||||
long abs_bitmask[NLONGS(ABS_CNT)] = {0};
|
||||
int i, has_axes, has_keys, num_buttons;
|
||||
int kernel24 = 0;
|
||||
EvdevPtr pEvdev = pInfo->private;
|
||||
|
||||
32
src/evdev.h
32
src/evdev.h
@@ -40,6 +40,22 @@
|
||||
#include <xkbstr.h>
|
||||
#endif
|
||||
|
||||
#ifndef EV_CNT /* linux 2.4 kernels and earlier lack _CNT defines */
|
||||
#define EV_CNT (EV_MAX+1)
|
||||
#endif
|
||||
#ifndef KEY_CNT
|
||||
#define KEY_CNT (KEY_MAX+1)
|
||||
#endif
|
||||
#ifndef REL_CNT
|
||||
#define REL_CNT (REL_MAX+1)
|
||||
#endif
|
||||
#ifndef ABS_CNT
|
||||
#define ABS_CNT (ABS_MAX+1)
|
||||
#endif
|
||||
#ifndef LED_CNT
|
||||
#define LED_CNT (LED_MAX+1)
|
||||
#endif
|
||||
|
||||
#define EVDEV_MAXBUTTONS 32
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 3
|
||||
@@ -47,7 +63,9 @@
|
||||
#endif
|
||||
|
||||
#define LONG_BITS (sizeof(long) * 8)
|
||||
#define NBITS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
||||
|
||||
/* Number of longs needed to hold the given number of bits */
|
||||
#define NLONGS(x) (((x) + LONG_BITS - 1) / LONG_BITS)
|
||||
|
||||
/* axis specific data for wheel emulation */
|
||||
typedef struct {
|
||||
@@ -120,12 +138,12 @@ typedef struct {
|
||||
|
||||
/* Cached info from device. */
|
||||
char name[1024];
|
||||
long bitmask[NBITS(EV_MAX)];
|
||||
long key_bitmask[NBITS(KEY_MAX)];
|
||||
long rel_bitmask[NBITS(REL_MAX)];
|
||||
long abs_bitmask[NBITS(ABS_MAX)];
|
||||
long led_bitmask[NBITS(LED_MAX)];
|
||||
struct input_absinfo absinfo[ABS_MAX];
|
||||
long bitmask[NLONGS(EV_CNT)];
|
||||
long key_bitmask[NLONGS(KEY_CNT)];
|
||||
long rel_bitmask[NLONGS(REL_CNT)];
|
||||
long abs_bitmask[NLONGS(ABS_CNT)];
|
||||
long led_bitmask[NLONGS(LED_CNT)];
|
||||
struct input_absinfo absinfo[ABS_CNT];
|
||||
|
||||
/* minor/major number */
|
||||
dev_t min_maj;
|
||||
|
||||
Reference in New Issue
Block a user