[Core] Add a dynamic_macro_stop_recording(void) function. #21108
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR refactors the code used to stop recording a dynamic macro into it's own new function, void dynamic_macro_stop_recording(void), allowing users to programmatically end the recording of a dynamic macro.
An example of how this could be useful is that it would allow the user to, in their keymap, change the behavior of the QK_DYNAMIC_MACRO_PLAY_* keys to behave more like Emacs' key macros - where hitting the play 'key' while recording will stop recording and immediately play back the key macro, without requiring the user first perform a separate key stroke to explicitly end recording - by adding a case like this example to their process_record_user function:
Other users may be able to imagine other situations where they'd like to programmattically end the recording of a dynamic macro (on a timer, perhaps, in case they start recording and then go AFK and forget to end the recording of their macro?).
On my local system, this change does not appear to change the size of the firmware produced.
Types of Changes
Issues Fixed or Closed by This PR
None.
Checklist