We have developed a site whcih has a horizontal orientation and are wanting to implement touchpad control with two fingers move left/right.
When you move two fingers left/right on touchpad, the site page is being scrolled left/right. Now we have implemented touchpad control with two fingers move up/down and page scrolled left/right.
How can we change touchpad control with two fingers move from up/down to left/right to scroll site page left/right using js or jQuery?
Two finger scrollOpen the Activities overview and start typing Mouse & Touchpad. Click on Mouse & Touchpad to open the panel. In the Touchpad section, make sure the Touchpad switch is set to on. Switch the Two-finger Scrolling switch to on.
To change the function of this gesture, select Start, select Settings, select Bluetooth & devices, and then select Touchpad. Under Four-finger gestures, in the Swipes box, select a gesture setting.
Try out these gestures on the touchpad of your Windows 10 laptop. Select an item: Tap on the touchpad. Scroll: Place two fingers on the touchpad and slide horizontally or vertically. Zoom in or out: Place two fingers on the touchpad and pinch in or stretch out.
If the Touchpad driver is outdated or not installed correctly, it could affect how two-finger scroll works. To fix the problem, you can update, reinstall or roll back the touchpad driver and then check if the feature functions properly again.
I may be a little late but had the same question before I stumbled over this question.
A little further investigation lead me to think that the best bet to capture trackpad scrolling would be the wheel
event.
function doScroll(e) {
// positive deltas are top and left
// down and right are negative
// horizontal offset e.deltaX
// vertical offset e.deltaY
console.log(`x:${e.deltaX} y:${e.deltaY}`);
e.preventDefault(); // disable the actual scrolling
}
window.addEventListener("wheel", doScroll, false);
I have prepared a fiddle that tells you the scroll direction and offset values but prevents the scrolling itself.
The wheel event has a delta property that (at least in Chrome) is sensitive to momentum and gives you the current relative scroll offset rather than the absolute scroll position available in the scroll
event.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With