Topic: To everyone who is experiencing mouse lag on Linux

Hey community!

I found a way to stop the mouse lag found when using the SponzaFPS demo on Linux.

It seems that centering the cursor takes too long for providing getAxis with the correct data.
The workaround is replacing

mx = getAxis("MOUSE_X")
my = getAxis("MOUSE_Y")

with

window = getWindowScale()
mx = window[1] / 2
my = window[2] / 2

in the MouseInput.lua file so that the values do not depend on how fast the xserver resets the cursor.

Sponk

Re: To everyone who is experiencing mouse lag on Linux

Hey Sponk,

Did you modify something else in the script ?
All I got is a shaky camera looking at the floor.

Re: To everyone who is experiencing mouse lag on Linux

No, my script is working perfectly like this.

Anyways, you could additionally try replacing

centerCursor()

with

if getSystemTick() % 3 == 0 then -- Experiment a little bit with the value. 3 is just an example
            centerCursor()
end

Sponk

Re: To everyone who is experiencing mouse lag on Linux

make sure you have Acceleration turned off, i used to have a issue like this when using XFCE compositing.