mirror of
https://github.com/X11Libre/xf86-input-evdev.git
synced 2026-04-14 11:44:16 +00:00
Compare commits
8 Commits
xf86-input
...
xf86-input
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6eab92c7e7 | ||
|
|
0e9990bf3b | ||
|
|
9d2156e5a6 | ||
|
|
f7850a4042 | ||
|
|
bd4102af6e | ||
|
|
22e816eb32 | ||
|
|
b6b377fe9a | ||
|
|
3772676fd6 |
@@ -22,7 +22,7 @@
|
||||
|
||||
AC_PREREQ(2.57)
|
||||
AC_INIT([xf86-input-evdev],
|
||||
2.3.1,
|
||||
2.3.3,
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
|
||||
xf86-input-evdev)
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ button event is registered. Property: "Evdev Middle Button Emulation".
|
||||
Sets the timeout (in milliseconds) that the driver waits before deciding
|
||||
if two buttons where pressed "simultaneously" when 3 button emulation is
|
||||
enabled. Default: 50. Property: "Evdev Middle Button Timeout".
|
||||
.TP 7
|
||||
.BI "Option \*qEmulateWheel\*q \*q" boolean \*q
|
||||
Enable/disable "wheel" emulation. Wheel emulation means emulating button
|
||||
press/release events when the mouse is moved while a specific real button
|
||||
|
||||
45
src/evdev.c
45
src/evdev.c
@@ -378,7 +378,7 @@ EvdevReopenTimer(OsTimerPtr timer, CARD32 time, pointer arg)
|
||||
|
||||
pEvdev->reopen_left--;
|
||||
|
||||
if (!pEvdev->reopen_left)
|
||||
if (pEvdev->reopen_left <= 0)
|
||||
{
|
||||
xf86Msg(X_ERROR, "%s: Failed to reopen device after %d attempts.\n",
|
||||
pInfo->name, pEvdev->reopen_attempts);
|
||||
@@ -464,6 +464,13 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
||||
*/
|
||||
else if (pEvdev->abs && pEvdev->tool) {
|
||||
memcpy(v, pEvdev->vals, sizeof(int) * pEvdev->num_vals);
|
||||
|
||||
if (pEvdev->swap_axes) {
|
||||
int tmp = v[0];
|
||||
v[0] = v[1];
|
||||
v[1] = tmp;
|
||||
}
|
||||
|
||||
if (pEvdev->flags & EVDEV_CALIBRATED)
|
||||
{
|
||||
v[0] = xf86ScaleAxis(v[0],
|
||||
@@ -476,12 +483,6 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
|
||||
pEvdev->calibration.max_y, pEvdev->calibration.min_y);
|
||||
}
|
||||
|
||||
if (pEvdev->swap_axes) {
|
||||
int tmp = v[0];
|
||||
v[0] = v[1];
|
||||
v[1] = tmp;
|
||||
}
|
||||
|
||||
if (pEvdev->invert_x)
|
||||
v[0] = (pEvdev->absinfo[ABS_X].maximum - v[0] +
|
||||
pEvdev->absinfo[ABS_X].minimum);
|
||||
@@ -616,7 +617,6 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||
return;
|
||||
|
||||
switch (ev->code) {
|
||||
case BTN_TOUCH:
|
||||
case BTN_TOOL_PEN:
|
||||
case BTN_TOOL_RUBBER:
|
||||
case BTN_TOOL_BRUSH:
|
||||
@@ -626,7 +626,11 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
|
||||
case BTN_TOOL_MOUSE:
|
||||
case BTN_TOOL_LENS:
|
||||
pEvdev->tool = value ? ev->code : 0;
|
||||
if (!(pEvdev->flags & EVDEV_TOUCHSCREEN))
|
||||
break;
|
||||
|
||||
case BTN_TOUCH:
|
||||
pEvdev->tool = value ? ev->code : 0;
|
||||
if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)))
|
||||
break;
|
||||
/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
|
||||
* BTN_LEFT. */
|
||||
@@ -1928,6 +1932,11 @@ EvdevProbe(InputInfoPtr pInfo)
|
||||
{
|
||||
xf86Msg(X_INFO, "%s: Found absolute tablet.\n", pInfo->name);
|
||||
pEvdev->flags |= EVDEV_TABLET;
|
||||
if (!pEvdev->num_buttons)
|
||||
{
|
||||
pEvdev->num_buttons = 7; /* LMR + scroll wheels */
|
||||
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
|
||||
}
|
||||
} else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
|
||||
TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
|
||||
if (num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
|
||||
@@ -2510,8 +2519,22 @@ EvdevInitProperty(DeviceIntPtr dev)
|
||||
|
||||
prop_calibration = MakeAtom(EVDEV_PROP_CALIBRATION,
|
||||
strlen(EVDEV_PROP_CALIBRATION), TRUE);
|
||||
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER, 32,
|
||||
PropModeReplace, 0, NULL, FALSE);
|
||||
if (pEvdev->flags & EVDEV_CALIBRATED) {
|
||||
int calibration[4];
|
||||
|
||||
calibration[0] = pEvdev->calibration.min_x;
|
||||
calibration[1] = pEvdev->calibration.max_x;
|
||||
calibration[2] = pEvdev->calibration.min_y;
|
||||
calibration[3] = pEvdev->calibration.max_y;
|
||||
|
||||
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
|
||||
32, PropModeReplace, 4, calibration,
|
||||
FALSE);
|
||||
} else if (pEvdev->flags & EVDEV_ABSOLUTE_EVENTS) {
|
||||
rc = XIChangeDeviceProperty(dev, prop_calibration, XA_INTEGER,
|
||||
32, PropModeReplace, 0, NULL,
|
||||
FALSE);
|
||||
}
|
||||
if (rc != Success)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user