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

296
Views
Best way to show others people cursor on the screen without affecting resources too much

I wonder how some apps can display collaborators' cursors on the screen and update their position in real time without affecting too much the resource of the client.

I tried to do that with websocket/onmousemove: when I move my mouse I send info to the server which send it to others clients and update my position with JS/CSS on their screen.

Is there a better solution?

Regards,

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

0

What you can do to get better performance would probably be to send / receive fewer packets, and calculate most of the mouse movement.

I mean, instead of sending every mouse move, you could send them once in a while (like 500ms), and then on the client receiving those moves, animate the cursor to the new position with an animation duration of the same length (500ms in this example).

In order to do so, in your onmousemove event you can use a global variable, like lastPacketTime, if the current timestamp Date.now() is below lastPacketTime + 500ms, return. Otherwise, send the packet, and update lastPacketTime

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!