Page 1 of 1

Mouse inputs ignored if a key is held down: workarounds?

Posted: Wed Feb 26, 2020 11:55 pm
by Sky_Render
So this is kind of awful. I've discovered that LOVE does not update love.mouse.isDown(), love.mousepressed, or love.mousereleased if any key on the keyboard is being held down when a mouse click is inputted. It only relents if 1. a new key is pressed or 2. the existing key is released. Is there any way to fix this or work around it? I can't very well tell my players "by the way, don't press any keys when trying to use the mouse", after all!

EDIT: Nevermind, it turns out that Windows is absurdly stupid about touchpads... It was a Windows issue, not a LOVE issue, and I just fixed it.

Re: Mouse inputs ignored if a key is held down: workarounds?

Posted: Thu Feb 27, 2020 12:04 am
by slime
Using this code I can't reproduce that behaviour, LÖVE correctly reports mouse presses in all situations for me. Are you sure it's not a bug in your code (or maybe a problem with your hardware or mouse/keyboard drivers)?

Code: Select all

function love.draw()
	love.graphics.print("mouse 1 pressed: " .. tostring(love.mouse.isDown(1)), 20, 20)
end

function love.mousepressed(...)
	print("mouse pressed", ...)
end

function love.mousereleased(...)
	print("mouse released", ...)
end