gitextensions / ICSharpCode.TextEditor

ICSharpCode.TextEditor for WinForms
14 stars 22 forks source link

Handle WM_MOUSEHWHEEL for horizontal touchpad scrolling #30

Closed mdonatas closed 1 year ago

mdonatas commented 1 year ago

It turns out that Panel on which this editor is based only handles WM_MOUSEWHEEL which gives vertical scrolling but doesn't handle WM_MOUSEHWHEEL which is fired during horizontal scroll. So I basically copy/pasted this code used for vertical scrolling and hooked it up to vertical scroll events. Methods in Win32Util also came from there.

Testing methodology

Manual testing with laptop-touchpad

Before

https://user-images.githubusercontent.com/483659/196259300-682a9691-6371-4fb7-b649-430647e09245.mp4

After

https://user-images.githubusercontent.com/483659/196259655-b21917cc-d3dd-424e-9a42-d1be80969565.mp4

p.s. I've also created a simple Form with a Panel and some oversized content in both x and y axises and confirmed that horizontal scrolling with touch-pad doesn't work image

mdonatas commented 1 year ago

Could I get a hacktoberfest-accepted label please 😊

RussKie commented 1 year ago

I decorated the repo with the topic as well.