playdate.getButtonState() unexpectedly tracks menu button

I'm doing this:

if playdate.getButtonState() ~= 0 then
	startGame()
end

But strangely it also responds to the Menu button, which means if people press Menu button the game starts!

I see no mention of any constant/value for the menu button in the docs.

output looks like this when opening menu

0	0	0
64	64	0
64	0	0
64	0	0
64	0	0
64	0	0

My workaround is to get more specific with the right side of my testing equation. No buttons is zero. Menu button is 64. Every other button is in between.

3 Likes