diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2023-03-23 21:00:09 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2023-03-23 21:00:09 -0700 |
commit | 99faf61abbd90f3d5da40788adc43c2883beb470 (patch) | |
tree | c305911012de36605bbf62ccf0d2b5022c314922 /main.lua | |
parent | 609f0b2fc850e9e6da8eb92b9d855c4e6ccf863b (diff) | |
download | text.love-99faf61abbd90f3d5da40788adc43c2883beb470.tar.gz |
mouse wheel support
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 10 |
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 |