From 99faf61abbd90f3d5da40788adc43c2883beb470 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 23 Mar 2023 21:00:09 -0700 Subject: mouse wheel support --- main.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.lua') diff --git a/main.lua b/main.lua index 31b7f5b..13f2d6a 100644 --- a/main.lua +++ b/main.lua @@ -250,6 +250,16 @@ function App.mousereleased(x,y, mouse_button) end end +function App.wheelmoved(dx,dy) + if Current_app == 'run' then + if run.mouse_wheel_move then run.mouse_wheel_move(dx,dy) end + elseif Current_app == 'source' then + if source.mouse_wheel_move then source.mouse_wheel_move(dx,dy) end + else + assert(false, 'unknown app "'..Current_app..'"') + end +end + function love.quit() if Current_app == 'run' then local source_settings = Settings.source -- cgit 1.4.1-2-gfad0