AnsweredAssumed Answered

How to use the middle mouse button to pan a map

Question asked by paul.haakma on Feb 13, 2019
Latest reply on Feb 13, 2019 by LDanzinger-esristaff

Is there any easy way to change the default mouse button used for panning a MapView on desktop (e.g. Windows/Mac) for the mouse?


By default, clicking and dragging the left mouse button pans the map around. I have a use case where some users would prefer to use the middle mouse button (I.e. typically the mouse wheel) for this. They are used to CAD programs that do this, where clicking with the left button is reserved for drawing and selection stuff and the middle button pans around. For them, this is intuitive and much faster.


The only way I can think is to place a MouseArea over the map, capture all mouse events and somehow manually pass them through to the MapView, somehow switching out a left click for middle when panning. But I'm not really even sure how to manually cause the map to pan, except by making it zoom to a point location to follow the mouse, which I expect would be quite slow and not keep up with the mouse movement.


Any ideas? It would be great if there was a property on the MapView object that could control this perhaps?


Lucas Danzinger