Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is it possible to use the zoom in, zoom out, and previous extent functions as mouse gestures in ArcMap? For example, say a user held down LShift then left click and dragged diagonally to the lower right. I would like that to function the same as zooming in, using the zoom in tool. Dragging in a different direction would do one of the other functions. A final function would be escaping from the command after a drag has been started, this would be the same as hitting the Esc button.

I assume this would have to be done in ArcObjects. I've done some searching around for zooming functions in ArcObjects but most of the stuff I've found refers to older versions. I'm not at all familiar with ArcObjects, so some pointers would be very helpful. I have access to both Arc 9 and 10.

share|improve this question
    
Try to mimic the mouse actions in ArcGIS API for Wpf to get the same look and feel as the ArcGIS Runtime will have: help.arcgis.com/en/webapi/wpf/help/index.html#/… –  MathiasWestin Jan 1 '12 at 11:37

2 Answers 2

In ArcMap 10 while using any tool, you can temporarily hold down [Z] to zoom in, [X] to zoom out, and [C] or [scroll wheel] to pan.

Source

share|improve this answer
    
Thanks, those are good to know. I actually use C to pan all the time. I still would much rather go with the mouse gestures method even though it looks like its going to be a lot more difficult. –  amasephy Nov 29 '11 at 18:22

This could be done using a custom tool (inherited from BaseTool). Override the mousedown, mouse move, keydown, and mouse up events. Keep an IDisplayFeedBack member variable. In the mousedown, initialize the member variable to an NewEnvelopeFeedback, and assign a symbol that uses esriROPNotXorPen. In the mouse move, call IDisplayFeedBack.MoveTo. In the mouse up, check to see where the final point is relative to the first point, and modify IActiveView.Extent accordingly.

If Esc is hit, handle that in the Keydown event. For checking if shift key is pressed, see this answer. I'm not aware of a way to distinguish between left and right shift keys.

share|improve this answer
    
Thanks for your reply. I should have also mentioned that I'm at a very low level in programming experience (mostly python). Would you be able to provide some jumpstart code that I could build this off of? –  amasephy Nov 29 '11 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.