# Trackpad mapping to mouse wheel

**URL:** <https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026>\
**Category:** Targets\
**Created:** [August 19, 2016, 9:33pm UTC](https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026 "2016-08-19T21:33:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Dowad](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/9de0a6/32.png) [@Tom\_Dowad](https://forum.xojo.com/u/Tom_Dowad)\
**Post date:** [August 19, 2016, 9:33pm UTC](https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026/1 "2016-08-19T21:33:20Z")

</div>

I have an application where the mouse wheel event is used for zooming in and out of a view in a canvas.  
This works perfectly with a wheel mouse  
As well, holding the mouse left button down while moving the mouse will drag the view left/right/up/down

The mouse down/drag works with the trackpad. Nevertheless two-finger drag seems more intuitive. That’s how I drag on my browser.

With the trackpad, one expects that pinching will change zoom. That “sort of” works on zoom in. It doesn’t seem to work at all for zoom out.

Also, two finger drag zooms in. So apparently that is generating wheel events also. That is very counter-intuitive. In particular because you cannot zoom out.

I’m not finding any documentation about how the trackpad relates to the mouse events.

TIA  
Tom

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [August 20, 2016, 6:27am UTC](https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026/2 "2016-08-20T06:27:30Z")

</div>

I think you will need declares to properly catch trackpad pinch events.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [August 20, 2016, 9:19am UTC](https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026/3 "2016-08-20T09:19:43Z")

</div>

The official equivalent to mouse wheel is two fingers drag. But that could change with each trackpad implementation.

[https://msdn.microsoft.com/en-us/library/windows/hardware/dn614021(v=vs.85).aspx?f=255&MSPPError=-2147217396](https://msdn.microsoft.com/en-us/library/windows/hardware/dn614021%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396)

But pinch is also used for zoom…

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:25pm UTC](https://forum.xojo.com/t/trackpad-mapping-to-mouse-wheel/33026/4 "2020-10-29T18:25:51Z")

</div>


