Closed soraxas closed 2 years ago
Please do elaborate a bit more on motivation. (E.g., real-life usecases and problems or why not simply branch using jump
in the above example - you only save like one or two lines of code.)
Like this, it looks like a very arbitrary feature proposal to me. I am not at all convinced that it is justified and actually makes sense.
Hi @kareltucek thanks for your response!
I do agree that what this feature proposal provides can already be achieved with branching jumps. What this feature tackle is to have an easy way to define common ending point (e.g. clean up actions, setting led text to something when macro starts, and using onExit
hook to reset things when done, etc.). This feature only avoids having to specify jumps on all possible exit points
(esp. when final
is given to command and it's not possible to chain command in a single line yet).
I'm perfectly fine if you want to close this PR
Closing, as this PR increases memory layout
Adds an onExit hook. Usage
Registered hook will be executed after the macro is exiting. Unlike label, this hook respect runtime encounter. The example will display
YES
for L-shift+MacroKey. MacroKey without L-shift will displayNO
. In both scenario, the display happens after the whole macro had finished (after the long delay in the end)