Merge template-live-editor-mobile

This commit is contained in:
Kartik K. Agaram 2024-09-10 20:34:05 -07:00
commit 827a162a1b
3 changed files with 4 additions and 4 deletions

View File

@ -70,10 +70,12 @@ function love.run()
-- other methods dispatch to real hardware
App.screen.resize = function(width, height, flags)
local has_text_input = love.keyboard.hasTextInput()
love.window.setMode(width, height, flags)
if OS == 'iOS' then
love.keyboard.setTextInput(true) -- magic. iOS seems to lose textinput events after calls to setMode.
-- https://github.com/love2d/love/issues/1959
love.keyboard.setTextInput(has_text_input) -- iOS recreates the window on setMode
-- this property is part of the window
-- https://github.com/love2d/love/issues/1959
love.keyboard.setKeyRepeat(true)
end
end

View File

@ -153,7 +153,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))

View File

@ -39,7 +39,6 @@ end
-- called only for real run
function App.initialize(arg)
love.keyboard.setTextInput(true) -- bring up keyboard on touch screen
love.keyboard.setKeyRepeat(true)
Editor_state = nil -- not used outside editor tests