MCPcopy Create free account
hub / github.com/breck7/scroll / clickRepeat

Function clickRepeat

external/.scrollLibs.js:9951–9965  ·  view source on GitHub ↗
(pos, button)

Source from the content-addressed store, hash-verified

9949
9950 var lastClick, lastDoubleClick
9951 function clickRepeat(pos, button) {
9952 var now = +new Date()
9953 if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) {
9954 lastClick = lastDoubleClick = null
9955 return "triple"
9956 } else if (lastClick && lastClick.compare(now, pos, button)) {
9957 lastDoubleClick = new PastClick(now, pos, button)
9958 lastClick = null
9959 return "double"
9960 } else {
9961 lastClick = new PastClick(now, pos, button)
9962 lastDoubleClick = null
9963 return "single"
9964 }
9965 }
9966
9967 // A mouse down can be a single click, double click, triple click,
9968 // start of selection drag, start of text drag, new cursor

Callers 1

onMouseDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected