Fix repeated rune input on Android

Resolves #6.
This commit is contained in:
Trevor Slocum 2024-02-20 11:20:47 -08:00
parent 7e5208a9f6
commit d17310185c
1 changed files with 11 additions and 1 deletions

12
game.go
View File

@ -275,7 +275,17 @@ func Update() error {
}
runeBuffer = ebiten.AppendInputChars(runeBuffer[:0])
for _, r := range runeBuffer {
INPUTCHARS:
for i, r := range runeBuffer {
if i > 0 {
for j, r2 := range runeBuffer {
if j == i {
break
} else if r2 == r {
continue INPUTCHARS
}
}
}
var err error
switch r {
case Bindings.ConfirmRune: