octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.38k stars 961 forks source link

How long does it take to run a single moveMouse command? #638

Open KCGD opened 3 years ago

KCGD commented 3 years ago

I have a program that moves my mouse according to input on my phone. I have the update rate for the mouse at 15ms which works fine, but having it run at full speed (using setInterval with no interval spesification) has considerable input lag. How long does it take to run a single movemouse command?

Expected Behavior

real time mouse moving

Current Behavior

also real time, except for max speed loops

Possible Solution

set the loop to the time it takes to run a single moveMouse command (which i currently dont know)

Steps to Reproduce (for bugs)

  1. have a moveMouse command running on a loop, observer lag between input and actual mouse movement

Context

The program i made is supposed to let me use my phone as a controller for the game Beamng.Drive (which supports mouse tracked turning for cars). It currently works fine, just want to achieve as minimal latency as possible.

Your Environment