MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / configureMouse

Function configureMouse

lib/web/CodeMirror/src/edit/mouse_events.js:116–127  ·  view source on GitHub ↗
(cm, repeat, event)

Source from the content-addressed store, hash-verified

114}
115
116function configureMouse(cm, repeat, event) {
117 let option = cm.getOption("configureMouse")
118 let value = option ? option(cm, repeat, event) : {}
119 if (value.unit == null) {
120 let rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey
121 value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"
122 }
123 if (value.extend == null || cm.doc.extend) value.extend = cm.doc.extend || event.shiftKey
124 if (value.addNew == null) value.addNew = mac ? event.metaKey : event.ctrlKey
125 if (value.moveOnDrag == null) value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey)
126 return value
127}
128
129function leftButtonDown(cm, pos, repeat, event) {
130 if (ie) setTimeout(bind(ensureFocus, cm), 0)

Callers 1

leftButtonDownFunction · 0.70

Calls 1

optionFunction · 0.70

Tested by

no test coverage detected