Page 1 of 1

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

Posted: Wed Jan 01, 2014 1:27 pm
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

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

Posted: Wed Jan 01, 2014 1:46 pm
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.