Commit 4cc2b952 authored by Peter Ganzhorn's avatar Peter Ganzhorn Committed by Peter Hutterer

fallback: Add IBM/Lenovo Scrollpoint mice quirk to enable smooth scrolling.

Instead of a scroll wheel these mice feature trackpoint-like sticks which
generate a huge amount of scroll events that need to be handled differently
than scroll wheel events.
Signed-off-by: default avatarPeter Ganzhorn <peter.ganzhorn@gmail.com>
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 74e20e0a
......@@ -211,6 +211,21 @@ fallback_flush_wheels(struct fallback_dispatch *dispatch,
if (!(device->seat_caps & EVDEV_DEVICE_POINTER))
return;
if (device->model_flags & EVDEV_MODEL_LENOVO_SCROLLPOINT) {
struct normalized_coords unaccel = { 0.0, 0.0 };
dispatch->wheel.y *= -1;
normalize_delta(device, &dispatch->wheel, &unaccel);
evdev_post_scroll(device,
time,
LIBINPUT_POINTER_AXIS_SOURCE_CONTINUOUS,
&unaccel);
dispatch->wheel.x = 0;
dispatch->wheel.y = 0;
return;
}
if (dispatch->wheel.y != 0) {
wheel_degrees.y = -1 * dispatch->wheel.y *
device->scroll.wheel_click_angle.y;
......
......@@ -1286,6 +1286,7 @@ evdev_read_model_flags(struct evdev_device *device)
MODEL(TABLET_NO_TILT),
MODEL(TABLET_MODE_NO_SUSPEND),
MODEL(LENOVO_CARBON_X1_6TH),
MODEL(LENOVO_SCROLLPOINT),
#undef MODEL
{ "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
{ NULL, EVDEV_MODEL_DEFAULT },
......
......@@ -130,6 +130,7 @@ enum evdev_device_model {
EVDEV_MODEL_MS_NANO_TRANSCEIVER = (1 << 28),
EVDEV_MODEL_TABLET_NO_TILT = (1 << 29),
EVDEV_MODEL_TABLET_MODE_NO_SUSPEND = (1 << 30),
EVDEV_MODEL_LENOVO_SCROLLPOINT = (1 << 31),
};
enum evdev_button_scroll_state {
......
......@@ -189,6 +189,21 @@ libinput:name:AlpsPS/2 ALPS GlidePoint:dmi:*svnHP:pnHPZBookStudioG3:*
libinput:tablet:input:b0003v256Cp*
LIBINPUT_MODEL_TABLET_NO_PROXIMITY_OUT=1
##########################################
# IBM
##########################################
#
# IBM/Lenovo Scrollpoint mouse. Instead of a scroll wheel these mice
# feature trackpoint-like sticks which generate a huge amount of scroll
# events that need to be handled differently than scroll wheel events
libinput:mouse:b0003v04B3p3100*
libinput:mouse:b0003v04B3p3103*
libinput:mouse:b0003v04B3p3105*
libinput:mouse:b0003v04B3p3108*
libinput:mouse:b0003v04B3p3109*
libinput:mouse:b0003v17EFp6049*
LIBINPUT_MODEL_LENOVO_SCROLLPOINT=1
##########################################
# LENOVO
##########################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment