Commit graph

16 commits

Author SHA1 Message Date
Ryan
fe18df9d41
Normalise Dynamic Macro keycodes (#18939)
* `DYN_REC_START1` -> `QK_DYNAMIC_MACRO_RECORD_START_1`

* `DYN_REC_START2` -> `QK_DYNAMIC_MACRO_RECORD_START_2`

* `DYN_MACRO_PLAY1` -> `QK_DYNAMIC_MACRO_PLAY_1`

* `DYN_MACRO_PLAY2` -> `QK_DYNAMIC_MACRO_PLAY_2`

* `DYN_REC_STOP` -> `QK_DYNAMIC_MACRO_RECORD_STOP`

* Update docs
2022-11-03 23:01:06 +00:00
Drashna Jaelre
542cb0a8ce [Core] Convert Dynamic Macro to a Core Feature (#5948)
* Convert Dynamic Macro to a Core Feature

This imports the code from Dynamic Macro into the core code, and handles it, as such.

This deprecates the old method but does not remove it, for legacy support. This way, no existing user files need to be touched.

Additionally, this reorganizes the documentation to better reflect the changes.

Also, it adds user hooks to the feature so users can customize the existing functionality.

Based heavily on and closes #2976

* Apply suggestions from code review

Co-Authored-By: fauxpark <fauxpark@gmail.com>
Co-Authored-By: noroadsleft <18669334+noroadsleft@users.noreply.github.com>

* Cleanup based on feedback

* Add short-form keycodes and document them

- add short-form keycodes to quantum/quantum_keycodes.h
- document the new aliases in docs/feature_dynamic_macros.md

* Add Dynamic Macros section and keycodes to docs/keycodes.md

* Make anti-nesting optional

* Add documentation for DYNAMIC_MACRO_NO_NESTING option

* Fix Merge artifacts

* Fix formatting typo in docs

Co-Authored-By: James Young <18669334+noroadsleft@users.noreply.github.com>

* Remove DYNAMIC_MACRO_RANGE as it's not needed

* Fix includes and layer var type
2019-11-04 22:59:13 -08:00
skullY
b624f32f94 clang-format changes 2019-08-30 15:01:52 -07:00
Fred Sundvik
67eeb889ba Fix dynamic macros on ChibiOS keyboards 2017-09-30 06:22:24 -10:00
Daniel Shields
606e13a47e Prevent the recording of looping dynamic macros.
If a macro play key is inadvertently recorded in a dynamic macro
a loop is created and the macro will not terminate when played.

This should be prevented.
2017-06-01 16:29:58 +01:00
Wojciech Siewierski
a1e156a3d2 dynamic_macro.h: Do not use backlight_toggle if backlight is disabled
Fixes #1199.
2017-05-05 00:11:24 +02:00
Wojciech Siewierski
10a7cd7e5a dynamic_macro.h: Add debug logs 2017-05-04 23:57:22 +02:00
Wojciech Siewierski
8e94c9b4cb dynamic_macro.h: Make the documentation more clear 2017-05-04 22:39:02 +02:00
Wojciech Siewierski
4b50ea15a9 dynamic_macro.h: Do not save the keys being held when stopping the recording
More specifically, we save them and then place the `macro_end` pointer
before them so they are essentially ignored and the other macro may
freely overwrite them.
2017-05-04 01:42:09 +02:00
Wojciech Siewierski
436d661775 dynamic_macro.h: Fix an off-by-two error
We need to check whether we just passed the after-the-end point of the
other macro. Instead we were checking whether we are going to reach it
now.
2017-05-04 01:26:35 +02:00
Wojciech Siewierski
5e2a999278 dynamic_macro.h: Always toggle the backlight twice as a notification
Apparently sometimes the backlight was toggled only once and it was left on.
2017-05-04 00:58:01 +02:00
Wojciech Siewierski
40fe30e4d6 dynamic_macro.h: Ignore all the initial key releases
Right after the user initiates the macro recording, they usually need
to release some keys used to access the DYN_REC_START layers. It makes
sense to ignore them.

Note: The keys used to access the DYN_REC_STOP key are *not* ignored.
2017-05-04 00:14:38 +02:00
Weiyi Lou
4ff40a551a Add DYN_REC_STOP to dynamic macros
Dynamic macro functionality is modified to check for `DYN_REC_STOP`, so
that macro recording can be stopped with a designated key combination
(e.g. `qs` or anything) instead of mandating the use of a `_DYN` layer.

`_DYN` layer stopping can still be done by passing `DYN_REC_STOP` within
`process_record_user()`:

    bool process_record_user(uint16_t keycode, keyrecord_t *record) {
      uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode);
      if (!process_record_dynamic_macro(macro_kc, record)) {
        return false;
      }
      return true;
    }
2017-04-30 19:21:44 +10:00
skullydazed
23839b8c6d Clarify the quantum license (#1042)
* Clarify the license for files we have signoff on

* Update against the currently signed off files

* Remove unused and not clearly licensed headers

* Replace an #endif I accidentally removed while resolving merge conflicts
2017-03-28 15:20:36 -07:00
Wojciech Siewierski
70f32842e5 Reduce the default dynamic macro buffer
There have been reports of it leaving not enough free memory preventing
the keyboard from working properly.
2016-10-09 12:52:39 +02:00
Wojciech Siewierski
39e8e61258 Implement the dynamic macros that are recorded in runtime 2016-08-18 01:37:13 +02:00