aboutsummaryrefslogtreecommitdiff
path: root/quantum/dynamic_macro.h
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2019-11-04 22:59:13 -0800
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2019-11-04 22:59:13 -0800
commit542cb0a8ce3f324c6bd46751d733daf86384a8f6 (patch)
tree08128a4e00a42fa0e78199d86f757a8d562952a9 /quantum/dynamic_macro.h
parent0e664f92c4d61d685259607d7257c53f60da5fc0 (diff)
downloadqmk_firmware-542cb0a8ce3f324c6bd46751d733daf86384a8f6.tar.gz
qmk_firmware-542cb0a8ce3f324c6bd46751d733daf86384a8f6.zip
[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
Diffstat (limited to 'quantum/dynamic_macro.h')
-rw-r--r--quantum/dynamic_macro.h20
1 files changed, 4 insertions, 16 deletions
diff --git a/quantum/dynamic_macro.h b/quantum/dynamic_macro.h
index c7632c004..fe9de6fa6 100644
--- a/quantum/dynamic_macro.h
+++ b/quantum/dynamic_macro.h
@@ -15,8 +15,10 @@
15 */ 15 */
16 16
17/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */ 17/* Author: Wojciech Siewierski < wojciech dot siewierski at onet dot pl > */
18#ifndef DYNAMIC_MACROS_H 18#pragma once
19#define DYNAMIC_MACROS_H 19
20/* Warn users that this is now deprecated and they should use the core feature instead. */
21#pragma message "Dynamic Macros is now a core feature. See updated documentation to see how to configure it: https://docs.qmk.fm/#/feature_dynamic_macros"
20 22
21#include "action_layer.h" 23#include "action_layer.h"
22 24
@@ -33,18 +35,6 @@
33# define DYNAMIC_MACRO_SIZE 128 35# define DYNAMIC_MACRO_SIZE 128
34#endif 36#endif
35 37
36/* DYNAMIC_MACRO_RANGE must be set as the last element of user's
37 * "planck_keycodes" enum prior to including this header. This allows
38 * us to 'extend' it.
39 */
40enum dynamic_macro_keycodes {
41 DYN_REC_START1 = DYNAMIC_MACRO_RANGE,
42 DYN_REC_START2,
43 DYN_REC_STOP,
44 DYN_MACRO_PLAY1,
45 DYN_MACRO_PLAY2,
46};
47
48/* Blink the LEDs to notify the user about some event. */ 38/* Blink the LEDs to notify the user about some event. */
49void dynamic_macro_led_blink(void) { 39void dynamic_macro_led_blink(void) {
50#ifdef BACKLIGHT_ENABLE 40#ifdef BACKLIGHT_ENABLE
@@ -272,5 +262,3 @@ bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record) {
272#undef DYNAMIC_MACRO_CURRENT_SLOT 262#undef DYNAMIC_MACRO_CURRENT_SLOT
273#undef DYNAMIC_MACRO_CURRENT_LENGTH 263#undef DYNAMIC_MACRO_CURRENT_LENGTH
274#undef DYNAMIC_MACRO_CURRENT_CAPACITY 264#undef DYNAMIC_MACRO_CURRENT_CAPACITY
275
276#endif