about summary refs log tree commit diff stats
path: root/main.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-03-23 21:00:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-03-23 21:00:09 -0700
commit99faf61abbd90f3d5da40788adc43c2883beb470 (patch)
treec305911012de36605bbf62ccf0d2b5022c314922 /main.lua
parent609f0b2fc850e9e6da8eb92b9d855c4e6ccf863b (diff)
downloadlines.love-99faf61abbd90f3d5da40788adc43c2883beb470.tar.gz
mouse wheel support
Diffstat (limited to 'main.lua')
-rw-r--r--main.lua10
1 files changed, 10 insertions, 0 deletions
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