tiny-pilot / tinypilot

Use your Raspberry Pi as a browser-based KVM.
https://tinypilotkvm.com
MIT License
2.99k stars 249 forks source link

Mouse map manual override #1145

Open db39 opened 1 year ago

db39 commented 1 year ago

Some users have found that their TinyPilot mouse does not have the same position as their target machine's mouse cursor. And the offset isn't fixed either. This suggests that the screen's reported resolution and the resolution being used by the mouse are different. i.e., the screen may output at 720p, but the mouse is working with the assumption that the resolution is 1080p for some reason.

Can we give users a way to tell TinyPilot that the remote screen is actually a different size than the device is reporting and map the mouse accordingly?

mtlynch commented 1 year ago

The place where we scale mouse coordinates to the remote screen is here:

https://github.com/tiny-pilot/tinypilot/blob/bf3c39302ecf643f288ec0e5da50c49e61a61944/app/hid/mouse.py#L20L26

It's possible we could integrate some user-controllable configuration here so the user can add offsets or custom scaling to the way we translate the x, y coordinates to the remote device.