mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 17:20:06 +01:00
Fixed horizontal scrolling on Logitech MX Master 2S/3
Logitech MX Master 2S and 3 by default use natural scrolling
for the horizontal scroll wheel, while the main wheel
uses traditional mode. This change inverts the default
direction of horizontal scrolling.
(cherry picked from commit 8490384c68)
This commit is contained in:
parent
a7d2b749f3
commit
62382f7d79
5 changed files with 25 additions and 0 deletions
|
|
@ -45,3 +45,13 @@ MatchBus=usb
|
|||
MatchVendor=0x046D
|
||||
MatchProduct=0x4011
|
||||
AttrPalmPressureThreshold=400
|
||||
|
||||
[Logitech MX Master 2S]
|
||||
MatchVendor=0x46D
|
||||
MatchProduct=0x4069
|
||||
ModelInvertHorizontalScrolling=1
|
||||
|
||||
[Logitech MX Master 3]
|
||||
MatchVendor=0x46D
|
||||
MatchProduct=0x4082
|
||||
ModelInvertHorizontalScrolling=1
|
||||
|
|
|
|||
|
|
@ -357,6 +357,11 @@ evdev_notify_axis(struct evdev_device *device,
|
|||
struct normalized_coords delta = *delta_in;
|
||||
struct discrete_coords discrete = *discrete_in;
|
||||
|
||||
if (device->scroll.invert_horizontal_scrolling) {
|
||||
delta.x *= -1;
|
||||
discrete.x *= -1;
|
||||
}
|
||||
|
||||
if (device->scroll.natural_scrolling_enabled) {
|
||||
delta.x *= -1;
|
||||
delta.y *= -1;
|
||||
|
|
@ -1841,6 +1846,10 @@ evdev_configure_device(struct evdev_device *device)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (evdev_device_has_model_quirk(device, QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING)) {
|
||||
device->scroll.invert_horizontal_scrolling = true;
|
||||
}
|
||||
|
||||
return fallback_dispatch_create(&device->base);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,10 @@ struct evdev_device {
|
|||
* used at runtime to enable/disable the feature */
|
||||
bool natural_scrolling_enabled;
|
||||
|
||||
/* set during device init to invert direction of
|
||||
* horizontal scrolling */
|
||||
bool invert_horizontal_scrolling;
|
||||
|
||||
/* angle per REL_WHEEL click in degrees */
|
||||
struct wheel_angle wheel_click_angle;
|
||||
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ quirk_get_name(enum quirk q)
|
|||
case QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD: return "ModelHPPavilionDM4Touchpad";
|
||||
case QUIRK_MODEL_HP_STREAM11_TOUCHPAD: return "ModelHPStream11Touchpad";
|
||||
case QUIRK_MODEL_HP_ZBOOK_STUDIO_G3: return "ModelHPZBookStudioG3";
|
||||
case QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING: return "ModelInvertHorizontalScrolling";
|
||||
case QUIRK_MODEL_LENOVO_L380_TOUCHPAD: return "ModelLenovoL380Touchpad";
|
||||
case QUIRK_MODEL_LENOVO_SCROLLPOINT: return "ModelLenovoScrollPoint";
|
||||
case QUIRK_MODEL_LENOVO_T450_TOUCHPAD: return "ModelLenovoT450Touchpad";
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ enum quirk {
|
|||
QUIRK_MODEL_HP_PAVILION_DM4_TOUCHPAD,
|
||||
QUIRK_MODEL_HP_STREAM11_TOUCHPAD,
|
||||
QUIRK_MODEL_HP_ZBOOK_STUDIO_G3,
|
||||
QUIRK_MODEL_INVERT_HORIZONTAL_SCROLLING,
|
||||
QUIRK_MODEL_LENOVO_L380_TOUCHPAD,
|
||||
QUIRK_MODEL_LENOVO_SCROLLPOINT,
|
||||
QUIRK_MODEL_LENOVO_T450_TOUCHPAD,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue