iOS keyboard repeats only once or twice

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:

  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)
    msg.post(".", “acquire_input_focus”)
    self.message = “label”
    self.node = gui.get_node(“text”)
    gui.show_keyboard(gui.KEYBOARD_TYPE_DEFAULT, false)
    end

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

  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)
    msg.post("@render:", “use_fixed_fit_projection”, { near = -1, far = 1 })
    end

  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:
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

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

Sure, done https://github.com/defold/defold/issues/6613

1 Like