buttonJustClicked and buttonJustHeld

There’s currently no good way of distinguishing a short button click and a long button press. Some users are relying on undocumented interaction of XButtonUp and XButtonHeld to trigger different actions. It would be useful to add buttonJustClicked which would trigger after button is released short after being pressed, and buttonJustHeld which triggers after button release after holding for some time, or maybe just the first as XButtonHeld covers most use cases.

2 Likes

Also playdate.XButtonUp and playdate.XButtonHeld are callbacks and cannot be used to make calls that need to happen in update, e.g. requesting network access. So I’m proposing to add playdate.buttonJustClicked(button) which would return a boolean like playdate.buttonJustPressed(button).