Possible touch input bug

Hello again!

I think I might’ve found an input bug relating to touch input, here are the repro steps:

  • Create an empty project
  • add a simple GUI with a GUI script
  • in the init function paste the following code:
    msg.post(".", "acquire_input_focus")
  • in the on_input function paste the following code:
    if action.released then print(there was a touch input!) print(action_id) end
  • build and run the project on a phone (reproed on an iPhone 6+)
  • tap the screen
  • notice that you get two inputs on one tap!
  • notice one has the action_id “click” and the other is “unnamed”

I’m not 100% on this bug, didn’t take the time to create an empty project to repro in, so it could be some weirdness in my own code, but figured there must at least be a nugget of an issue in there since there’s an “unnamed” action_id!

If you print the action fields of the unnamed one, you should probably see the acc_x, acc_y, acc_z being set, as it’s the accelerometer signal you are probably seeing. The reasoning behind the unnamed action, is that it’s not really an action in the case of the accelerometer, similarly to when you move the mouse on a desktop pc without clicking it. This should of course be better documented, and the accelerometer should be possible to turn off.

3 Likes