-- Mouse wheel callback on love2d function love.load() love.graphics.setDefaultFilter("nearest", "nearest") font = love.graphics.newFont(16) wx, wy = 0, 0 end function love.update(dt) end function love.draw() love.graphics.clear(0.2, 0.4, 0.6, 1.0) love.graphics.setFont(font) love.graphics.setColor(1, 1, 1, 1) local t local ty = 24 t = string.format("Wheel x : %d", wx) love.graphics.print(t, 2, ty) ty = ty + 24 t = string.format("Wheel y : %d", wy) love.graphics.print(t, 2, ty) ty = ty + 24 love.graphics.print("FPS: " .. tostring(love.timer.getFPS()), 2, 2) end function love.keypressed(key, isrepeat) if key == "escape" then -- ESC key to exit love.event.quit() end end function love.wheelmoved(x, y) wx = wx + x wy = wy + y end