code: function onMouseDown(e){var cm=this,display=cm.display;if(signalDOMEvent(cm,e)||display.activeTouch&&display.input.supportsTouch()){return;}display.input.ensurePolled();display.shift=e.shiftKey;if(eventInWidget(display,e)){if(!webkit){// Briefly turn off draggability, to allow widgets to do
  // normal dragging things.
  display.scroller.draggable=false;setTimeout(function(){return display.scroller.draggable=true;},100);}return;}if(clickInGutter(cm,e)){return;}var pos=posFromMouse(cm,e),button=e_button(e),repeat=pos?clickRepeat(pos,button):"single";window.focus();// #3261: make sure, that we're not starting a second selection
  if(button==1&&cm.state.selectingText){cm.state.selectingText(e);}if(pos&&handleMappedButton(cm,button,pos,repeat,e)){return;}if(button==1){if(pos){leftButtonDown(cm,pos,repeat,e);}else if(e_target(e)==display.scroller){e_preventDefault(e);}}else if(button==2){if(pos){extendSelection(cm.doc,pos);}setTimeout(function(){return display.input.focus();},20);}else if(button==3){if(captureRightClick){onContextMenu(cm,e);}else{delayBlurEvent(cm);}}}
docs: A mouse down can be a single click, double click, triple click, start of selection drag, start of text drag, new cursor (ctrl-click), rectangle drag (alt-drag), or xwin middle-click-paste. Or it might be a click on something we should not interfere with, such as a scrollbar or widget.