Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

162
Views
Can javascript recognize mouse movements?

I would like to know if there is a way to "monitor" mouse movements. I'm developing automation in python and I don't know if there's a way for javascript to recognize what I'm planning to do. I think teleporting the mouse pointer could give some hint of automation. I think disguising the movement could be an option. I plan to use Pyautogui, Selenium wouldn't run what I need.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

You can detect mouse movement by listening for the mousemove event and get the coordinates of the pointer with MouseEvent.pageX and MouseEvent.pageY:

document.addEventListener('mousemove', function(e){
  const xCoordinate = e.pageX;
  const yCoordinate = e.pageY;
  output.innerHTML = `x: ${xCoordinate}, y: ${yCoordinate}`
})
<p id="output"></p>

about 4 years ago · Juan Pablo Isaza Report

0

Html Code

<div onmousemove="myFunction(event)"></div>

Js code

function myFunction(e) {
  var x = e.clientX;
  var y = e.clientY;
  var coor = "Coordinates: (" + x + "," + y + ")";
  document.getElementById("demo").innerHTML = coor;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!