MCPcopy Create free account
hub / github.com/Useful-Scripts-Extension/useful-script / mousemove

Function mousemove

scripts/smoothScroll.js:937–947  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

935 );
936 let firstMove = true;
937 function mousemove(e) {
938 let deltaX = Math.abs(refereceX - e.clientX);
939 let deltaY = Math.abs(refereceY - e.clientY);
940 let movedEnough = Math.max(deltaX, deltaY) > 10;
941 if (firstMove && movedEnough) {
942 addEvent("mouseup", remove);
943 firstMove = false;
944 }
945 speedX = ((e.clientX - refereceX) * 10) / 1000;
946 speedY = ((e.clientY - refereceY) * 10) / 1000;
947 }
948 function remove(e) {
949 removeEvent("mousemove", mousemove);
950 removeEvent("mousedown", remove);

Callers

nothing calls this directly

Calls 1

addEventFunction · 0.85

Tested by

no test coverage detected