Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

Sometimes inputs are fired twice consistently #109

Open Auroriax opened 1 year ago

Auroriax commented 1 year ago

Describe the bug In some cases the game catches input twice per keypress. I've seen this in some games uploaded to Itch as well as when someone did a screen share. It's annoying! Haven´t managed to reproduce consistently yet, it seems to have something to do with focus?

Reproduction Steps

  1. TODO
  2. TODO
  3. TODO

What did you expect would happen? No double presses

OS & Browser version, desktop/mobile Windows 10 Firefox

Screenshots, example projects, other relevant issues, etc. It reproduced for me in https://potomax.itch.io/7segments but also in my own games via the share link.

david-pfx commented 1 year ago

This has been a problem for me like forever, and is on my list to fix. The reason is that PS relies on KeyUp to stop generating keystrokes, and if KeyUp is delayed you can get multiple inputs. I find it happens often, but varies from game to game.

IMO the solution has to be to stop using KeyUp, but I don't know enough yet to propose an alternative.