hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.13k stars 663 forks source link

exp/textinput: pressing enter is often ignored #3015

Closed hajimehoshi closed 5 months ago

hajimehoshi commented 5 months ago

Ebitengine Version

546c47878dd89adfa9f61627e0df1d73c94ebfa8

Operating System

Go Version (go version)

go version go1.22.3 darwin/arm64

What steps will reproduce the problem?

  1. Run examples/textinput on iOS Safari
  2. Select the multiple line form
  3. Press Enter

What is the expected result?

A new line is inserted whenever pressing enter

What happens instead?

A new line is not inserted often.

Anything else you feel useful to add?

No response

hajimehoshi commented 5 months ago

Apparently there is a delay between pressing a key and calling Update on iOS Safari. Is this fixable?

hajimehoshi commented 5 months ago

I found keyup events are fired too early. I'll adjust the timing of UpdateInputFromEvent.