Question over d-pad input callbacks. Why no held variant?

Hi everyone,

I am very much new to this and game development in general. I've been waiting a long time to dive into the SDK and I'm having a good time so far.

Whilst writing small test code and looking over the SDK, I've noticed the list of input Button Callbacks (Inside Playdate) seems to have variants of the A and B buttons being held down, but no similar variant for the d-pad buttons.

I appreciate that this could have been a design choice, but I can't work out why and what the case against them would be. Having a handler for holding down the right d-pad in a 2d side-scroller seems like a no brainier.

Can anyone with more dev experience province an answer?

Apologies for the silly question and thanks in advance :playdate:

I think the button held callback doesn't do what you think it does. From what I can see it's a special utility in case you'd like to implement secondary action. It will be triggered after 1s of it being held down. If you want to do a side scroller you can just look if the d-pad button is currently pressed on the update loop. This is documented in the Lua example in the doc.


@Ketebece is correct!

Ahh yes you are right. I was indeed getting a little ahead of myself.

Note to self: Test first before asking questions? :sweat_smile:

Thanks :slight_smile:

1 Like