From 7e832e46de26989b81f2fbf58a0f391b2b0c1aaf Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Sun, 20 Jun 2021 10:14:19 +0800 Subject: [PATCH] Add Mac centric Shift and Alt + GUI Macros (#13107) Co-authored-by: filterpaper --- docs/keycodes.md | 48 +++++++++++++++++++++----------------- docs/mod_tap.md | 5 +++- quantum/quantum_keycodes.h | 20 +++++++++++----- 3 files changed, 45 insertions(+), 28 deletions(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index f3c519b130..1e9f34774b 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -381,26 +381,29 @@ See also: [Mouse Keys](feature_mouse_keys.md) See also: [Modifier Keys](feature_advanced_keycodes.md#modifier-keys) -|Key |Aliases |Description | -|----------|-------------------------------|------------------------------------------------------| -|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | -|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | -|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` | -|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | -|`RCTL(kc)`| |Hold Right Control and press `kc` | -|`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt (AltGr) and press `kc` | -|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | -|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` | -|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | -|`LSA(kc)` | |Hold Left Shift and Left Alt and press `kc` | -|`RSA(kc)` |`SAGR(kc)` |Hold Right Shift and Right Alt (AltGr) and press `kc` | -|`RCS(kc)` | |Hold Right Control and Right Shift and press `kc` | -|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | -|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc` | -|`KC_MEH` | |Left Control, Shift and Alt | -|`KC_HYPR` | |Left Control, Shift, Alt and GUI | +|Key |Aliases |Description | +|----------|----------------------------------|------------------------------------------------------| +|`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` | +|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | +|`LALT(kc)`|`A(kc)`, `LOPT(kc)` |Hold Left Alt and press `kc` | +|`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)` |Hold Left GUI and press `kc` | +|`RCTL(kc)`| |Hold Right Control and press `kc` | +|`RSFT(kc)`| |Hold Right Shift and press `kc` | +|`RALT(kc)`|`ROPT(kc)`, `ALGR(kc)` |Hold Right Alt (AltGr) and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` | +|`LSG(kc)` |`SGUI(kc)`, `SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and Left GUI and press `kc` | +|`LAG(kc)` | |Hold Left Alt and Left GUI and press `kc` | +|`RSG(kc)` | |Hold Right Shift and Right GUI and press `kc` | +|`RAG(kc)` | |Hold Right Alt and Right GUI and press `kc` | +|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | +|`LSA(kc)` | |Hold Left Shift and Left Alt and press `kc` | +|`RSA(kc)` |`SAGR(kc)` |Hold Right Shift and Right Alt (AltGr) and press `kc` | +|`RCS(kc)` | |Hold Right Control and Right Shift and press `kc` | +|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | +|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | +|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc` | +|`KC_MEH` | |Left Control, Shift and Alt | +|`KC_HYPR` | |Left Control, Shift, Alt and GUI | ## Mod-Tap Keys :id=mod-tap-keys @@ -417,7 +420,10 @@ See also: [Mod-Tap](mod_tap.md) |`RSFT_T(kc)` | |Right Shift when held, `kc` when tapped | |`RALT_T(kc)` |`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt (AltGr) when held, `kc` when tapped | |`RGUI_T(kc)` |`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | -|`SGUI_T(kc)` |`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LSG_T(kc)` |`SGUI_T(kc)`, `SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LAG_T(kc)` | |Left Alt and GUI when held, `kc` when tapped | +|`RSG_T(kc)` | |Right Shift and GUI when held, `kc` when tapped | +|`RAG_T(kc)` | |Right Alt and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | |`LSA_T(kc)` | |Left Shift and Left Alt when held, `kc` when tapped | |`RSA_T(kc)` |`SAGR_T(kc)` |Right Shift and Right Alt (AltGr) when held, `kc` when tapped | diff --git a/docs/mod_tap.md b/docs/mod_tap.md index 6a2bcbc15e..f4d128482b 100644 --- a/docs/mod_tap.md +++ b/docs/mod_tap.md @@ -37,7 +37,10 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations |`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | |`RALT_T(kc)`|`ROPT_T(kc)`, `ALGR_T(kc)` |Right Alt when held, `kc` when tapped | |`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | -|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LSG_T(kc)` |`SGUI_T(kc)`, `SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LAG_T(kc)` | |Left Alt and GUI when held, `kc` when tapped | +|`RSG_T(kc)` | |Right Shift and GUI when held, `kc` when tapped | +|`RAG_T(kc)` | |Right Alt and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | |`LSA_T(kc)` | |Left Shift and Alt when held, `kc` when tapped | |`RSA_T(kc)` |`SAGR_T(kc)` |Right Shift and Right Alt (AltGr) when held, `kc` when tapped | diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 316c20fcef..c361dd670e 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -538,9 +538,13 @@ enum quantum_keycodes { #define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc)) #define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc)) #define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc)) -#define SGUI(kc) (QK_LGUI | QK_LSFT | (kc)) -#define SCMD(kc) SGUI(kc) -#define SWIN(kc) SGUI(kc) +#define LSG(kc) (QK_LSFT | QK_LGUI | (kc)) +#define SGUI(kc) LSG(kc) +#define SCMD(kc) LSG(kc) +#define SWIN(kc) LSG(kc) +#define LAG(kc) (QK_LALT | QK_LGUI | (kc)) +#define RSG(kc) (QK_RSFT | QK_RGUI | (kc)) +#define RAG(kc) (QK_RALT | QK_RGUI | (kc)) #define LCA(kc) (QK_LCTL | QK_LALT | (kc)) #define LSA(kc) (QK_LSFT | QK_LALT | (kc)) #define RSA(kc) (QK_RSFT | QK_RALT | (kc)) @@ -765,9 +769,13 @@ enum quantum_keycodes { #define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI #define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI #define HYPR_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 SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI -#define SCMD_T(kc) SGUI_T(kc) -#define SWIN_T(kc) SGUI_T(kc) +#define LSG_T(kc) MT(MOD_LSFT | MOD_LGUI, kc) // Left Shift + GUI +#define SGUI_T(kc) LSG_T(kc) +#define SCMD_T(kc) LSG_T(kc) +#define SWIN_T(kc) LSG_T(kc) +#define LAG_T(kc) MT(MOD_LALT | MOD_LGUI, kc) // Left Alt + GUI +#define RSG_T(kc) MT(MOD_RSFT | MOD_RGUI, kc) // Right Shift + GUI +#define RAG_T(kc) MT(MOD_RALT | MOD_RGUI, kc) // Right Alt + GUI #define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt #define LSA_T(kc) MT(MOD_LSFT | MOD_LALT, kc) // Left Shift + Alt #define RSA_T(kc) MT(MOD_RSFT | MOD_RALT, kc) // Right Shift + Alt