Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Add a dynamic_macro_stop_recording(void) function. #21108

Merged
merged 8 commits into from
Jun 2, 2023

Conversation

ariane-emory
Copy link
Contributor

@ariane-emory ariane-emory commented Jun 2, 2023

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:

  case QK_DYNAMIC_MACRO_PLAY_1:
  case QK_DYNAMIC_MACRO_PLAY_2:
    if (record->event.pressed)
      dynamic_macro_stop_recording();
    return true;

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

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

None.

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label Jun 2, 2023
@drashna drashna merged commit c754f64 into qmk:develop Jun 2, 2023
@ariane-emory ariane-emory deleted the dynamic-macro-stop-recording branch June 16, 2023 03:15
jesperhellberg pushed a commit to jesperhellberg/qmk_firmware that referenced this pull request Sep 9, 2023
thismarvin pushed a commit to thismarvin/qmk_firmware that referenced this pull request Sep 27, 2023
akeep pushed a commit to akeep/qmk_firmware that referenced this pull request Oct 2, 2023
csolje pushed a commit to csolje/qmk_firmware that referenced this pull request Oct 21, 2023
jashort pushed a commit to jashort/qmk_firmware that referenced this pull request Nov 20, 2023
autoferrit pushed a commit to SpaceRockMedia/bastardkb-qmk that referenced this pull request Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants