I have an image that I've set up with jQuery UI to be draggable. This works fine but now I'd like to be able to Shift-drag on the image to draw a box on the image and not have it move. So if the Shift key is held down I don't want to do the drag.
I've tried putting
if(e.shiftKey)return;
at the top of the drag_start, dragging, and drag_stop functions but this doesn't do anything because the drag operation seems to be done internally in jQuery UI and the calls to drag_start, dragging and drag_stop are just courtesy calls to let you know what jQueryUI is currently doing.
Is there a way to disable the drag if the Shift key is held down?
Thanks
(For more information on this see my "answer" farther below with a jsfiddle.)