How can I check a WheelEvent is from mouse wheel or touchpad in qml on Windows?
-
I tried this
var isTrackPad = wheel.pixelDelta !== Qt.point(0,0);as this says.But it seems pixelDelta works only on Mac. Is there other method to check if a wheel event is from mouse wheel or touchpad on Windows?
onWheel: { var horizontal = false; var isTrackPad = wheel.pixelDelta !== Qt.point(0,0); if (Math.abs(wheel.angleDelta.x) > Math.abs(wheel.angleDelta.y)) { delta = wheel.angleDelta.x horizontal = true } else { delta = wheel.angleDelta.y } if ((isTrackPad && horizontal) || (!isTrackPad && wheel.modifiers === xxx.ScrollModifiersH)) { ... } }I also tried
WheelHandlerandWheelEvent.deviceas this. But I received only mouse device