Slab icon indicating copy to clipboard operation
Slab copied to clipboard

Clicks get dropped at low framerate

Open megagrump opened this issue 3 years ago • 3 comments

Using love.mouse.isDown is not sufficient for reliable click detection. Clicks may occur between mouse sampling points and go unnoticed by the game/application. The lower the framerate, the higher the probability that this happens.

Solution: use love.mousepressed and love.mousereleased instead, and make sure the click event has an effect even when mousereleased gets called in the same frame as mousepressed.

megagrump avatar Dec 20 '21 00:12 megagrump

I'd probably leave this one for you as I don't have any idea how to solve this as i haven't yet experienced this issue in love 🤔

flamendless avatar Dec 20 '21 08:12 flamendless

You can test this by adding love.timer.sleep(.2) at the bottom of love.draw in main.lua. It's gonna be pretty difficult to click anything.

The same problem was apparently occuring in Keyboard.lua. The same solution would work for the mouse.

megagrump avatar Dec 20 '21 08:12 megagrump

This is now fixed for clicks, but still an issue when resizing a window at low framerates. Possibly other places too.

megagrump avatar Dec 21 '21 18:12 megagrump