laplab
(Nikita)
#1
When exactly in the game lifecycle button callbacks and input handlers are called? I see two possible options:
- Right after the
playdate.update()
- Immediately when the event happens (
playdate.update()
is interrupted in order for the callback to be executed)
From my experiments on the Simulator it seems that (1) is true. However, the documentation does not cover this question and I want to be sure.
willco
(Will)
#2
Update() is not interrupted. The button state is tracked internally and the callbacks are called on the next run loop pass. Hope that helps.
laplab
(Nikita)
#3
What does “next run loop pass” mean in this context? After the update() call on the frame button press happened has finished?
willco
(Will)
#4
Yup. The update call is allowed to finish, it won't be preempted by a button press.