From 5afe11a9c42062c23991d5da62c1d90616f4e7da Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Sep 2024 19:25:11 -0700 Subject: [PATCH 1/2] don't always pop up keyboard on mobile devices We don't want to do this during app initialization because other forks might not start out with an editor on screen even if this one does. We don't want to perform this side-effect on edit.mouse_press, which also runs in tests. --- edit.lua | 1 - main.lua | 1 - run.lua | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/edit.lua b/edit.lua index f65486c..9b4864c 100644 --- a/edit.lua +++ b/edit.lua @@ -228,7 +228,6 @@ function edit.quit(State) end function edit.mouse_press(State, x,y, mouse_button) - love.keyboard.setTextInput(true) -- bring up keyboard on touch screen if State.search_term then return end State.mouse_down = mouse_button --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos)) diff --git a/main.lua b/main.lua index 232308e..4cca3b4 100644 --- a/main.lua +++ b/main.lua @@ -116,7 +116,6 @@ function check_love_version_for_tests() end function App.initialize(arg) - love.keyboard.setTextInput(true) -- bring up keyboard on touch screen love.keyboard.setKeyRepeat(true) love.graphics.setBackgroundColor(1,1,1) diff --git a/run.lua b/run.lua index 2cdd892..22be332 100644 --- a/run.lua +++ b/run.lua @@ -168,6 +168,7 @@ end function run.mouse_press(x,y, mouse_button) Cursor_time = 0 -- ensure cursor is visible immediately after it moves + love.keyboard.setTextInput(true) -- bring up keyboard on touch screen return edit.mouse_press(Editor_state, x,y, mouse_button) end From 4af6f7b9e756e6b3add0ed61ea9fc0e0709d874a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 10 Sep 2024 19:35:06 -0700 Subject: [PATCH 2/2] bugfix in source editor --- source.lua | 1 + source_edit.lua | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/source.lua b/source.lua index d24957c..2c5e18e 100644 --- a/source.lua +++ b/source.lua @@ -285,6 +285,7 @@ end function source.mouse_press(x,y, mouse_button) Cursor_time = 0 -- ensure cursor is visible immediately after it moves + love.keyboard.setTextInput(true) -- bring up keyboard on touch screen --? print('mouse click', x, y) --? print(Editor_state.left, Editor_state.right) --? print(Log_browser_state.left, Log_browser_state.right) diff --git a/source_edit.lua b/source_edit.lua index 2dca05d..53bd16a 100644 --- a/source_edit.lua +++ b/source_edit.lua @@ -234,7 +234,6 @@ function edit.quit(State) end function edit.mouse_press(State, x,y, mouse_button) - love.keyboard.setTextInput(true) -- bring up keyboard on touch screen if State.search_term then return end State.mouse_down = mouse_button --? print_and_log(('edit.mouse_press: cursor at %d,%d'):format(State.cursor1.line, State.cursor1.pos))