LWJGL / lwjgl

[LEGACY] LWJGL 2.X - The Lightweight Java Game Library.
http://legacy.lwjgl.org/
543 stars 209 forks source link

[LWJGL2] Mouse Dx/Dy reporting incorrectly at high mouse polling rates #163

Open Sk1er opened 3 years ago

Sk1er commented 3 years ago

LWJGL2 is used by Minecraft until version 1.13. Millions of players use versions prior to this weekly and are affected by this bug.

When using a high poll rate (tested with 1000), the values returned by Mouse.getDx() and Mouse.getDy() become invalid and do not represent the true state of how the mouse has moved. When moving smoothly, there will be random large single inputs that may dramatically move the cursor more than it should. These happen randomly and I have found no pattern that causes them. (Example https://youtu.be/FOsleZsyzWE). I did some further digging and this seems only to happen when the mouse is grabbed (Mouse.setGrabbed(true)). The root cause seems to be somewhere in native code but that's outside my skillset to push further

ghost commented 1 year ago

I do not even know what Mouse.getDx() and Mouse.getDy() is used for anyways