diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2024-05-19 23:11:27 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2024-05-19 23:11:27 -0700 |
commit | c622737166bdfa3b038891aeb72bdf2a66bfd222 (patch) | |
tree | 0351d402b57bef7cf5cf6464eacb369a7824d829 | |
parent | 732ae69382f5ca86c689b566823305d709e9c738 (diff) | |
parent | 8219db2bcd31bee0f5cf5c4a92c3f6cd6a684e6d (diff) | |
download | text.love-c622737166bdfa3b038891aeb72bdf2a66bfd222.tar.gz |
Merge lines.love
-rw-r--r-- | main.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/main.lua b/main.lua index 1ff8b68..582f05a 100644 --- a/main.lua +++ b/main.lua @@ -317,6 +317,17 @@ function App.mousereleased(x,y, mouse_button) end end +function App.mousemoved(x,y, dx,dy, is_touch) + if current_app_is_warning() then return end + if Current_app == 'run' then + if run.mouse_move then run.mouse_move(dx,dy) end + elseif Current_app == 'source' then + if source.mouse_move then source.mouse_move(dx,dy) end + else + assert(false, 'unknown app "'..Current_app..'"') + end +end + function App.wheelmoved(dx,dy) if current_app_is_warning() then return end if Current_app == 'run' then @@ -328,6 +339,17 @@ function App.wheelmoved(dx,dy) end end +function App.mousefocus(in_focus) + if current_app_is_warning() then return end + if Current_app == 'run' then + if run.mouse_focus then run.mouse_focus(in_focus) end + elseif Current_app == 'source' then + if source.mouse_focus then source.mouse_focus(in_focus) end + else + assert(false, 'unknown app "'..Current_app..'"') + end +end + function love.quit() if Disable_all_quit_handlers then return end if current_app_is_warning() then return end |