From cfc4149712217625fcb75e50348094fd9df432f5 Mon Sep 17 00:00:00 2001 From: Luke Silva Date: Fri, 27 Jan 2017 10:28:42 +1100 Subject: Add ability to use tap macros without using functions --- quantum/quantum_keycodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 4853655f9..4566395fd 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -246,6 +246,7 @@ enum quantum_keycodes { #define M(kc) (kc | QK_MACRO) +#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8) #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) // L-ayer, T-ap - 256 keycode max, 16 layer max -- cgit v1.2.3-24-g4f1b From a3357d078ee80123040679a357f63e93ff24c4c6 Mon Sep 17 00:00:00 2001 From: Luke Silva Date: Sat, 28 Jan 2017 18:42:35 +1100 Subject: Add support for various tapping macros A macro key can now be easily set to act as a modifier on hold, and press a shifted key when tapped. Or to switch layers when held, and again press a shifted key when tapped. Various other helper defines have been created which send macros when the key is pressed, released and tapped, cleaning up the action_get_macro function inside keymap definitions. The layer switching macros require a GCC extension - 'compound statements enclosed within parentheses'. The use of this extension is already present within the macro subsystem of this project, so its use in this commit should not cause any additional issues. MACRO_NONE had to be cast to a (macro_t*) to suppress compiler warnings within some tapping macros. --- quantum/quantum_keycodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 4566395fd..e0d469561 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -249,6 +249,7 @@ enum quantum_keycodes { #define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8) #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) + // L-ayer, T-ap - 256 keycode max, 16 layer max #define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8)) -- cgit v1.2.3-24-g4f1b