A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
699
stars
581
forks
source link
The TypeScript `control.onEvent()` `flags` argument is not passed to the DAL/CODAL event listener #5709
Open
microbit-carlos opened 2 weeks ago
The
control.onEvent()
C++ function checks if any flag is provided, and if not it set theEventFlags::QueueIfBusy
by default: https://github.com/microsoft/pxt-microbit/blob/5b0d30fae81e856f98a17b7f1db60843bd438dcd/libs/core/control.cpp#L304-L307However, the
registerWithDal()
function then ignores theflags
argument: https://github.com/microsoft/pxt-microbit/blob/5b0d30fae81e856f98a17b7f1db60843bd438dcd/libs/core/codal.cpp#L99-L104So, it ultimately depends on the CODAL default beings set to
MESSAGE_BUS_LISTENER_QUEUE_IF_BUSY
via theEVENT_LISTENER_DEFAULT_FLAGS
config: