Description:
Hello, there’s a problem on iOS when entering/deleting text. When I try to add/delete characters using standard iOS keyboard and holding down a key it repeats it only once or twice.
Steps to reproduce the behaviour:
-
Create empty mobile game project
-
Add .gui and .gui_script files
-
In .gui add a font and a text node
-
In .gui_script add this code and assign gui_script to corresponding .gui:
function init(self)
msg.post(".", “acquire_input_focus”)
self.message = “label”
self.node = gui.get_node(“text”)
gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, false)
endfunction on_input(self, action_id, action)
if action_id == hash(“text”) then
self.message = self.message … action.text
gui.set_text(self.node, self.message)
elseif action_id == hash(“backspace”) and action.repeated then
local l = string.len(self.message)
self.message = string.sub(self.message, 0, l-1)
gui.set_text(self.node, self.message)
end
end -
In game.input_binding add key trigger Backspace: backspace and text trigger Text: text
-
In main.script leave only this:
function init(self)
msg.post("@render:", “use_fixed_fit_projection”, { near = -1, far = 1 })
end -
In main.collection add .gui component file to go
-
Create an iOS bundle
-
Deploy to real device, I use ios-deploy for example
Expected behaviour:
I expect to see characters added/deleted continuously when holding down a key.
Defold version:
-
Version 1.3.2
-
Platform: iOS
-
OS: iOS 14.4.1
-
Device: iPhone 7
Minimal repro case project:
prototype.zip (4.8 MB)
Additional info:
I tried some ways to solve it, like increasing/decreasing repeat interval/repeat delay in game.project, or removing action.repeated, the only thing it does is decrease/increase amount of characters added/deleted, then it stops repeating either way