FWIW, playdate.crankDocked()
is called on docking, if you want to define it.
And better yet, input handlers can include crankDocked = function()
even though that's currently missing from the input handler docs. I have used this successfully in my Playtime clock app.
(In both cases, crankUndocked
works too.)