Skip to main content

onOverlayEvent

An overlay's lifecycle event: before it appears, once it is on screen, when the viewer engages it, when it goes away.

Type​

assocArray: { type, payload }

Events​

typeWhenPayload, besides overlayId and associatedPanel
will-appearBefore the overlay showscanAppear, canFocus: the defaults for your build
did-appearThe overlay is on screennone
did-engageThe viewer pressed OK on itnone
did-dismissTimeout, Back or dismissOverlay()focusRestoredBySDK
Payload fieldTypeDescription
overlayIdstringThe overlay's ID; echo it in your setDataToOverlay answer.
associatedPanelstringThe panel type the overlay opens.
canAppearbooleanThe default permission to appear.
canFocusbooleanThe default permission to take focus.
focusRestoredBySDKbooleanfalse when the overlay held focus and the SDK didn't restore it: place focus yourself.

Example​

sub onMaestroOverlayEvent(event as object)
overlayEvent = event.getData()
payload = overlayEvent?.payload
if overlayEvent?.type = "will-appear"
m.maestro.setDataToOverlay = { overlayId: payload.overlayId, canAppear: true, canFocus: false }
else if overlayEvent?.type = "did-dismiss"
if payload.focusRestoredBySDK <> true then m.yourFocusTarget.setFocus(true)
end if
end sub

Notes​

  • Answer will-appear at once with setDataToOverlay; without an answer the SDK uses the defaults after a timeout.
  • On did-engage the SDK opens associatedPanel and sets showPanel = true.
  • See Overlay Integration.