From b6102d04897a795818cd43ff2d48e20417a927e5 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 19 May 2024 22:40:27 -0700 Subject: [PATCH 1/2] mousemoved handler --- main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.lua b/main.lua index b40ddf2..2cb7192 100644 --- a/main.lua +++ b/main.lua @@ -319,6 +319,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 From 8219db2bcd31bee0f5cf5c4a92c3f6cd6a684e6d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 19 May 2024 22:41:52 -0700 Subject: [PATCH 2/2] mousefocus handler --- main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main.lua b/main.lua index 2cb7192..232308e 100644 --- a/main.lua +++ b/main.lua @@ -341,6 +341,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