Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicks get dropped at low framerate #102

Open
megagrump opened this issue Dec 20, 2021 · 3 comments · Fixed by #107
Open

Clicks get dropped at low framerate #102

megagrump opened this issue Dec 20, 2021 · 3 comments · Fixed by #107
Assignees
Labels
bug Something isn't working enhancement New feature or request v1.0.0

Comments

@megagrump
Copy link
Contributor

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.

@flamendless
Copy link
Owner

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 🤔

@megagrump
Copy link
Contributor Author

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.

@flamendless flamendless added bug Something isn't working enhancement New feature or request v1.0.0 labels Dec 21, 2021
@megagrump
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request v1.0.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants