bugfix: initial textinput event on iOS

akkartik
Nov 19, 2023, 7:08 PM
GVOLLPQFFP5G7KCCSCPH42ZHGA5BORMTYN63FUNPXWW7FUK5OW2AC

Dependencies

Change contents

  • edit in main.lua at line 3
    [5.1864]
    [21.3]
    OS = love.system.getOS()
  • edit in main.lua at line 13
    [4.1][4.1:26](),[4.26][5.20:21](),[5.1931][5.20:21](),[5.184348][5.20:21]()
    OS = love.system.getOS()
  • replacement in main.lua at line 219
    [5.1203][3.0:107]()
    love.keyboard.setTextInput(true) -- magic. keeps iOS from losing textinput events after switching apps.
    [5.1203]
    [5.188176]
    if OS == 'iOS' then
    love.keyboard.setTextInput(true) -- magic. iOS is prone to losing textinput events.
    -- https://github.com/love2d/love/issues/1959
    end
  • replacement in app.lua at line 71
    [5.870][5.994:1036](),[5.994][5.994:1036]()
    App.screen.resize = love.window.setMode
    [5.870]
    [5.1036]
    App.screen.resize = function(width, height, flags)
    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
    end
    end