Mouse Wheel Down/Up does not available in the love.mouserele

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
poorenglish
Prole
Posts: 47
Joined: Thu Sep 24, 2009 1:49 pm

Mouse Wheel Down/Up does not available in the love.mouserele

Post by poorenglish »

Mouse Wheel Down/Up does not available in the love.mousereleased()

Code: Select all

function love:load()
	count = 1
end

function love.draw()
	love.graphics.print(count,100,100)

end

function love.mousepressed(x, y, button)

end

function love.mousereleased(x, y, button)
	if button == "wd" then
		count = count +1
	end
end
this program is NO function
change to

Code: Select all

function love:load()
	count = 1
end

function love.draw()
	love.graphics.print(count,100,100)
end

function love.mousepressed(x, y, button)
	if button == "wd" then
		count = count +1
	end
end

function love.mousereleased(x, y, button)

end
This program is available

in the Wiki http://www.love2d.org/wiki/love.mousereleased,the "wd" and "wu" are also in the MouseConstant
User avatar
Lafolie
Inner party member
Posts: 809
Joined: Tue Apr 05, 2011 2:59 pm
Location: SR388
Contact:

Re: Mouse Wheel Down/Up does not available in the love.mouse

Post by Lafolie »

The mouse wheel scrolling has no released events because there is no physical release of the wheel. When scrolling the wheel will send a signal for either up or down. The user/player has either scrolled and fired the event or not scrolled at all. It is not possible to 'hold down the mouse scroll' - continuous scrolling will just fire multiple events.

There is nothing wrong with the second example you posted.
Do you recognise when the world won't stop for you? Or when the days don't care what you've got to do? When the weight's too tough to lift up, what do you? Don't let them choose for you, that's on you.
Post Reply

Who is online

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