Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

297
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda