From d6f764adbe5b5f0fa13fe966401365a476a1a4cc Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 18 Dec 2023 07:30:09 -0800 Subject: [PATCH 1/2] backport a critical patch for iOS https://github.com/love2d/love/issues/1959#issuecomment-1817959751 --- app.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/app.lua b/app.lua index fc17d3e..0e384ab 100644 --- a/app.lua +++ b/app.lua @@ -74,6 +74,7 @@ function love.run() 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.setKeyRepeat(true) end end From af5fea3ee01c14df5eb9ac944c7940643385e2e9 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 18 Dec 2023 07:32:27 -0800 Subject: [PATCH 2/2] discourage nativefs; it isn't reliable on iOS https://github.com/love2d/love/issues/1997#issuecomment-1859045425 I'm still leaving it in, just not enabling it by default. One consequence of this change: driver.love edits will now go to the save dir, which I've tried before and found quite confusing. But it seems like the right trade-off for mobile apps; people are more likely to run into iOS than to try to make changes with driver.love. --- app.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app.lua b/app.lua index 0e384ab..d8c28af 100644 --- a/app.lua +++ b/app.lua @@ -84,7 +84,7 @@ function love.run() App.screen.print = love.graphics.print App.open_for_reading = function(filename) - local result = nativefs.newFile(filename) + local result = love.filesystem.newFile(filename) local ok, err = result:open('r') if ok then return result @@ -107,7 +107,7 @@ function love.run() end App.open_for_writing = function(filename) - local result = nativefs.newFile(filename) + local result = love.filesystem.newFile(filename) local ok, err = result:open('w') if ok then return result @@ -128,9 +128,9 @@ function love.run() f:close() return --[[status]] true end - App.files = nativefs.getDirectoryItems - App.mkdir = nativefs.createDirectory - App.remove = nativefs.remove + App.files = love.filesystem.getDirectoryItems + App.mkdir = love.filesystem.createDirectory + App.remove = love.filesystem.remove App.source_dir = love.filesystem.getSource()..'/' -- '/' should work even on Windows App.current_dir = nativefs.getWorkingDirectory()..'/' App.save_dir = love.filesystem.getSaveDirectory()..'/'