MCPcopy Index your code
hub / github.com/csev/py4e / onMouseDown

Function onMouseDown

tools/pythonauto/static/codemirrorepl/codemirror.js:2493–2528  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

2491 // middle-click-paste. Or it might be a click on something we should
2492 // not interfere with, such as a scrollbar or widget.
2493 function onMouseDown(e) {
2494 if (signalDOMEvent(this, e)) return;
2495 var cm = this, display = cm.display;
2496 display.shift = e.shiftKey;
2497
2498 if (eventInWidget(display, e)) {
2499 if (!webkit) {
2500 // Briefly turn off draggability, to allow widgets to do
2501 // normal dragging things.
2502 display.scroller.draggable = false;
2503 setTimeout(function(){display.scroller.draggable = true;}, 100);
2504 }
2505 return;
2506 }
2507 if (clickInGutter(cm, e)) return;
2508 var start = posFromMouse(cm, e);
2509 window.focus();
2510
2511 switch (e_button(e)) {
2512 case 1:
2513 if (start)
2514 leftButtonDown(cm, e, start);
2515 else if (e_target(e) == display.scroller)
2516 e_preventDefault(e);
2517 break;
2518 case 2:
2519 if (webkit) cm.state.lastMiddleDown = +new Date;
2520 if (start) extendSelection(cm.doc, start);
2521 setTimeout(bind(focusInput, cm), 20);
2522 e_preventDefault(e);
2523 break;
2524 case 3:
2525 if (captureRightClick) onContextMenu(cm, e);
2526 break;
2527 }
2528 }
2529
2530 var lastClick, lastDoubleClick;
2531 function leftButtonDown(cm, e, start) {

Callers

nothing calls this directly

Calls 11

leftButtonDownFunction · 0.85
signalDOMEventFunction · 0.70
eventInWidgetFunction · 0.70
clickInGutterFunction · 0.70
posFromMouseFunction · 0.70
e_buttonFunction · 0.70
e_targetFunction · 0.70
e_preventDefaultFunction · 0.70
extendSelectionFunction · 0.70
bindFunction · 0.70
onContextMenuFunction · 0.70

Tested by

no test coverage detected