iOS keyboard repeats only once or twice

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:

  1. Create empty mobile game project

  2. Add .gui and .gui_script files

  3. In .gui add a font and a text node

  4. In .gui_script add this code and assign gui_script to corresponding .gui:
    function init(self)".", “acquire_input_focus”)
    self.message = “label”
    self.node = gui.get_node(“text”)
    gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, false)

    function 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)

  5. In game.input_binding add key trigger Backspace: backspace and text trigger Text: text

  6. In main.script leave only this:
    function init(self)"@render:", “use_fixed_fit_projection”, { near = -1, far = 1 })

  7. In main.collection add .gui component file to go

  8. Create an iOS bundle

  9. 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: (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

We need to look into this. Could you please create a ticket on GitHub as well?

Sure, done

1 Like