]> git.baikalelectronics.ru Git - kernel.git/commit
HID: input: simplify/fix high-res scroll event handling
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Oct 2018 18:25:24 +0000 (11:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 29 Oct 2018 18:25:24 +0000 (11:25 -0700)
commitb9a06d327da9562c11f2ca607476717c43f6139a
treee0ecf95d6cc0174c8c5b106fec229ccad191e79a
parent952e1b31018d5f60c1d4e96cd0c0200d3c8131a8
HID: input: simplify/fix high-res scroll event handling

Commit 6203d16a9901 ("HID: input: Create a utility class for counting
scroll events") created the helper function

    hid_scroll_counter_handle_scroll()

to handle high-res scroll events and also expose them as regular wheel
events.

But the resulting algorithm was unstable, and causes scrolling to be
very unreliable.  When you hit the half-way mark of the highres
multiplier, small highres movements will incorrectly translate into big
traditional wheel movements, causing odd jitters.

Simplify the code and make the output stable.

NOTE! I'm pretty sure this will need further tweaking.  But this at
least turns a unusable mouse wheel on my Logitech MX Anywhere 2S into
a usable one.

Cc: Jiri Kosina <jikos@kernel.org>
Cc: Harry Cutts <hcutts@chromium.org>
Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Cc: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/hid/hid-input.c