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

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Sky_Render
Prole
Posts: 48
Joined: Fri Jul 05, 2019 2:59 am

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

Post 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.
Last edited by Sky_Render on Thu Feb 27, 2020 12:06 am, edited 1 time in total.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

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

Post 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
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 7 guests