sprig
sprig copied to clipboard
Button keydown-holding functions differently on device vs. web
when you press a button once on the physical console, the console registers that as a single input. On the web, however, holding down a button causes multiple inputs. This should be corrected so that inputs are consistent between the web and spade.
@leomcelroy please verify exactly what we want to do here to make things consistent - my $0.02 is that it may be the case that users have tested more on the website, and thus perhaps the behavior there is what should be retained...?
The intended behavior is for button presses to trigger once, not repeatedly.
ROOM makes use of holding down keys on web to move the player, so changing this behavior would make the game unplayable. As a compromise, perhaps there could be an API for changing settings?
setSettings({
keydownRepeat: true // default: false
});
// or expose a `sprig` or `sprigSettings` next to `api`
sprig.keydownRepeat = true;
Technical note: KeyboardEvent.repeat
is not reliable for determining repeated keydown events. This is confirmed by MDN docs.
Wow that game is amazing.
@DevIos01 are you still interested in working on this?
Hey @recursiveforte feel free to take it if you want, currently stuck on hardware stuff so you can take over this issue :)