sysmouse(4): Fix ums(4)-style T-axis reporting via evdev protocol

- Do not report T-axis wheel events as button presses
- Reverse T-axis to match Linux
- Remove wrong comment. T-axis buttons state should be checked by level not
    by edge to allow continuous wheel tilt reporting

Reviewed by:		gonzo
Approved by:		gonzo (mentor)
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D12676
This commit is contained in:
Vladimir Kondratyev 2017-11-01 22:30:36 +00:00
parent f3f8069493
commit d52d8bce16
2 changed files with 6 additions and 6 deletions

View file

@ -107,11 +107,11 @@ smdev_evdev_write(int x, int y, int z, int buttons)
}
break;
case EVDEV_SYSMOUSE_T_AXIS_UMS:
/* XXX: Edge triggering should be used here */
if (buttons & (1 << 5))
if (buttons & (1 << 6))
evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1);
else if (buttons & (1 << 6))
else if (buttons & (1 << 5))
evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1);
buttons &= ~((1 << 5)|(1 << 6));
/* PASSTHROUGH */
case EVDEV_SYSMOUSE_T_AXIS_NONE:
default:

View file

@ -139,11 +139,11 @@ sysmouse_evdev_store(int x, int y, int z, int buttons)
}
break;
case EVDEV_SYSMOUSE_T_AXIS_UMS:
/* XXX: Edge triggering should be used here */
if (buttons & (1 << 5))
if (buttons & (1 << 6))
evdev_push_rel(sysmouse_evdev, REL_HWHEEL, 1);
else if (buttons & (1 << 6))
else if (buttons & (1 << 5))
evdev_push_rel(sysmouse_evdev, REL_HWHEEL, -1);
buttons &= ~((1 << 5)|(1 << 6));
/* PASSTHROUGH */
case EVDEV_SYSMOUSE_T_AXIS_NONE:
default: