The OS is Windows 8 on a Retina Macbook PRO.
i need to support both vertical scrolling using the trackpad and horizontal scrolling in my app.
I would like to move the WPF scrollviewer position based on the two finger swipes up-down (vertical scrolling) and left-right (horizontal scrolling).
As far as i see the vertical scrolling on the trackpad gets translated to a mouse wheel event in the framework. However, I found no way to recognize if a mouse wheel event is a horizontal scroll.
what events should i handle in WPF to be able to implement this?
I wrote an article especially for you to know how to handle horizontal scrolling of touchpad in a WPF application. That is Support Horizontal Scrolling of TouchPad in WPF Application - walterlv
We need to fetch
WM_MOUSEHWHEELmessage from our WPF window. Yes! That mouse wheel message. We fetch vertical data from it before, but we now fetch horizontal data from it.At first, we should hook the window message.
Next, handle
WM_MOUSEHWHEEL:You can write horizontal scrolling code in
OnMouseTiltmethod.Better yet, you could pack all the codes above in a more common class and raise a
MouseTiltevent just like raisingMouseWheelevent.