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 4853655f95..4566395fd8 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 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 4566395fd8..e0d4695618 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 From f46c2b3ca07c83e13bea6fc33a3c95fed4a9ece2 Mon Sep 17 00:00:00 2001 From: Erez Zukerman Date: Tue, 31 Jan 2017 21:31:05 -0500 Subject: Introduces ALGR_T for dual-function AltGr --- 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 4853655f95..91324be35d 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -290,6 +290,7 @@ enum quantum_keycodes { #define CTL_T(kc) MT(MOD_LCTL, kc) #define SFT_T(kc) MT(MOD_LSFT, kc) #define ALT_T(kc) MT(MOD_LALT, kc) +#define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR #define GUI_T(kc) MT(MOD_LGUI, kc) #define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal #define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl -- cgit v1.2.3 From c17070eca545f654f91cf3dcba6c6c611e0f8d03 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Wed, 1 Feb 2017 15:35:21 +0700 Subject: Add layer switcher keycodes: OUT_AUTO, OUT_USB, OUT_BT, OUT_BLE --- quantum/quantum_keycodes.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 4853655f95..4f1345b49f 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -141,6 +141,16 @@ enum quantum_keycodes { PRINT_ON, PRINT_OFF, + // output selection + OUT_AUTO, + OUT_USB, +#ifdef BLUETOOTH_ENABLE + OUT_BT, +#endif +#ifdef ADAFRUIT_BLE_ENABLE + OUT_BLE, +#endif + // always leave at the end SAFE_RANGE }; -- cgit v1.2.3 From 97816df7e7aa8710c8a0837b2abe008e0c765f2a Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Fri, 10 Feb 2017 06:06:59 +0700 Subject: Implement tap mod dual role for right side mods. --- quantum/quantum_keycodes.h | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 8a78a58c9f..e562c9a18b 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -39,14 +39,14 @@ enum quantum_keycodes { QK_CHORDING = 0x5600, QK_CHORDING_MAX = 0x56FF, #endif - QK_MOD_TAP = 0x6000, - QK_MOD_TAP_MAX = 0x6FFF, - QK_TAP_DANCE = 0x7100, - QK_TAP_DANCE_MAX = 0x71FF, + QK_TAP_DANCE = 0x5700, + QK_TAP_DANCE_MAX = 0x57FF, #ifdef UNICODEMAP_ENABLE - QK_UNICODE_MAP = 0x7800, - QK_UNICODE_MAP_MAX = 0x7FFF, + QK_UNICODE_MAP = 0x5800, + QK_UNICODE_MAP_MAX = 0x5FFF, #endif + QK_MOD_TAP = 0x6000, + QK_MOD_TAP_MAX = 0x7FFF, #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, @@ -298,15 +298,29 @@ enum quantum_keycodes { #define OSM(mod) (mod | QK_ONE_SHOT_MOD) // M-od, T-ap - 256 keycode max -#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0xF) << 8)) +#define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8)) + #define CTL_T(kc) MT(MOD_LCTL, kc) +#define LCTL_T(kc) MT(MOD_LCTL, kc) +#define RCTL_T(kc) MT(MOD_RCTL, kc) + #define SFT_T(kc) MT(MOD_LSFT, kc) +#define LSFT_T(kc) MT(MOD_LSFT, kc) +#define RSFT_T(kc) MT(MOD_RSFT, kc) + #define ALT_T(kc) MT(MOD_LALT, kc) +#define LALT_T(kc) MT(MOD_LALT, kc) +#define RALT_T(kc) MT(MOD_RALT, kc) #define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR + #define GUI_T(kc) MT(MOD_LGUI, kc) +#define LGUI_T(kc) MT(MOD_LGUI, kc) +#define RGUI_T(kc) MT(MOD_RGUI, kc) + #define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal #define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl #define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui +#define RCAG_T(kc) MT((MOD_RCTL | MOD_RALT | MOD_RGUI), kc) // Right control alt and gui #define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ #define SCMD_T(kc) MT((MOD_LGUI | MOD_LSFT), kc) #define SWIN_T(kc) SCMD_T(kc) -- cgit v1.2.3 From b92515f139a80763b9b0b77ed4440cd9635fafac Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Sat, 11 Feb 2017 00:36:08 +0700 Subject: Make room for 'loose keycodes' by halving UNICODE_MAP range --- quantum/quantum_keycodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index e562c9a18b..ab2e790269 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -43,7 +43,7 @@ enum quantum_keycodes { QK_TAP_DANCE_MAX = 0x57FF, #ifdef UNICODEMAP_ENABLE QK_UNICODE_MAP = 0x5800, - QK_UNICODE_MAP_MAX = 0x5FFF, + QK_UNICODE_MAP_MAX = 0x5BFF, #endif QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, @@ -54,7 +54,7 @@ enum quantum_keycodes { // Loose keycodes - to be used directly - RESET = 0x7000, + RESET = 0x5C00, DEBUG, MAGIC_SWAP_CONTROL_CAPSLOCK, MAGIC_CAPSLOCK_TO_CONTROL, -- cgit v1.2.3 From 8c93c5d9ab8a0a69d84f707db71f417b66402693 Mon Sep 17 00:00:00 2001 From: Priyadi Iman Nurcahyo Date: Mon, 13 Feb 2017 14:55:35 +0700 Subject: Add keycodes to turn on, turn off and toggle faux clicky --- quantum/quantum_keycodes.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index ab2e790269..cc7a5013f6 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -86,6 +86,13 @@ enum quantum_keycodes { AU_OFF, AU_TOG, +#ifdef FAUXCLICKY_ENABLE + // Faux clicky + FC_ON, + FC_OFF, + FC_TOG, +#endif + // Music mode on/off/toggle MU_ON, MU_OFF, -- cgit v1.2.3 From 69ea10f9a9407415d8cbb5575a08bd73d5ddd7f9 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 15 Feb 2017 11:25:33 -0500 Subject: adds layer tap toggle --- quantum/quantum_keycodes.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index cc7a5013f6..f36c8044e9 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -41,16 +41,18 @@ enum quantum_keycodes { #endif QK_TAP_DANCE = 0x5700, QK_TAP_DANCE_MAX = 0x57FF, -#ifdef UNICODEMAP_ENABLE - QK_UNICODE_MAP = 0x5800, - QK_UNICODE_MAP_MAX = 0x5BFF, -#endif + QK_LAYER_TAP_TOGGLE = 0x5800, + QK_LAYER_TAP_TOGGLE_MAX = 0x58FF, QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, #endif +#ifdef UNICODEMAP_ENABLE + QK_UNICODE_MAP = 0x8000, + QK_UNICODE_MAP_MAX = 0x83FF, +#endif // Loose keycodes - to be used directly @@ -304,6 +306,9 @@ enum quantum_keycodes { // One-shot mod #define OSM(mod) (mod | QK_ONE_SHOT_MOD) +// Layer tap-toggle +#define TT(layer) (layer | QK_LAYER_TAP_TOGGLE) + // M-od, T-ap - 256 keycode max #define MT(mod, kc) (kc | QK_MOD_TAP | ((mod & 0x1F) << 8)) -- cgit v1.2.3 From 6788cbd76291e1f3103a350598f7bf5d523a7310 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 15 Feb 2017 12:39:58 -0500 Subject: give error if both unicode/map are enabled --- quantum/quantum_keycodes.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'quantum/quantum_keycodes.h') diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index f36c8044e9..63b626926d 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -45,6 +45,9 @@ enum quantum_keycodes { QK_LAYER_TAP_TOGGLE_MAX = 0x58FF, QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, +#if defined(UNICODEMAP_ENABLE) && defined(UNICODE_ENABLE) + #error "Cannot enable both UNICODEMAP && UNICODE" +#endif #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, -- cgit v1.2.3