I use mouse wheel input in my game to zoom in and out. This has stopped working recently, maybe because of Defold being updated.
For example, when scrolling only up, mouse_wheel_down
also fires:
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
DEBUG:SCRIPT: up
DEBUG:SCRIPT: down
With this code:
function on_input(self, action_id, action)
if action.value == 1 then
if action_id == hash("mouse_wheel_up") then
print("up")
end
if action_id == hash("mouse_wheel_down") then
print("down")
end
end
end
Minimal project:
scroll_wheel.zip (2.1 KB)
Defold 1.9.0 on Mac, when running the game from the editor with CMD+B.