1
0
Fork 0

Add C(), A() and G() to match already existing S() (#4673)

This commit is contained in:
fauxpark 2019-01-26 08:12:48 +11:00 committed by Drashna Jaelre
parent 2f009d7461
commit 79b58937f4
12 changed files with 66 additions and 64 deletions

View file

@ -60,21 +60,21 @@ Sometimes, you might want to switch between layers in a macro or as part of a ta
These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then `kc` will be sent. On release, the keyup event for `kc`, then the modifier will be sent. These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then `kc` will be sent. On release, the keyup event for `kc`, then the modifier will be sent.
|Key |Aliases |Description | |Key |Aliases |Description |
|----------|----------------------|----------------------------------------------------| |----------|-------------------------------|----------------------------------------------------|
|`LCTL(kc)`| |Hold Left Control and press `kc` | |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | |`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|`LALT(kc)`| |Hold Left Alt and press `kc` | |`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI 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` | |`RCTL(kc)`| |Hold Right Control and press `kc` |
|`RSFT(kc)`| |Hold Right Shift and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` |
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | |`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` |
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress.
@ -110,20 +110,20 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations
|Key |Aliases |Description | |Key |Aliases |Description |
|------------|-----------------------------------------------------------------|-------------------------------------------------------| |------------|-----------------------------------------------------------------|-------------------------------------------------------|
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | |`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | |`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | |`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | |`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|`RALT_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 | |`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|`HYPR_T(kc)`|`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|`HYPR_T(kc)`|`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
## Caveats ## Caveats

View file

@ -319,43 +319,43 @@ This is a reference only. Each group of keys links to the page documenting their
## [Modifiers](feature_advanced_keycodes.md#modifier-keys) ## [Modifiers](feature_advanced_keycodes.md#modifier-keys)
|Key |Aliases |Description | |Key |Aliases |Description |
|----------|----------------------|----------------------------------------------------| |----------|-------------------------------|----------------------------------------------------|
|`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI | |`LCTL(kc)`|`C(kc)` |Hold Left Control and press `kc` |
|`KC_MEH` | |Hold Left Control, Shift and Alt | |`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` |
|`LCTL(kc)`| |Hold Left Control and press `kc` | |`LALT(kc)`|`A(kc)` |Hold Left Alt and press `kc` |
|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | |`LGUI(kc)`|`G(kc)`, `LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` |
|`LALT(kc)`| |Hold Left Alt and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` |
|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` |
|`RCTL(kc)`| |Hold Right Control and press `kc` | |`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` |
|`RSFT(kc)`| |Hold Right Shift and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)` |Hold Right GUI and press `kc` |
|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)` |Hold Left Shift and GUI and press `kc` |
|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` |
|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI 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` | |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` |
|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`|
|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`KC_MEH` | |Left Control, Shift and Alt |
|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | |`KC_HYPR` | |Left Control, Shift, Alt and GUI |
## [Mod-Tap Keys](feature_advanced_keycodes.md#mod-tap) ## [Mod-Tap Keys](feature_advanced_keycodes.md#mod-tap)
|Key |Aliases |Description | |Key |Aliases |Description |
|------------|-----------------------------------------------------------------|-------------------------------------------------------| |------------|-----------------------------------------------------------------|-------------------------------------------------------|
|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | |`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped |
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | |`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped |
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | |`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped |
|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped |
|`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped | |`LGUI_T(kc)`|`LCMD_T(kc)`, `LWIN_T(kc)`, `GUI_T(kc)`, `CMD_T(kc)`, `WIN_T(kc)`|Left GUI when held, `kc` when tapped |
|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped |
|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped |
|`RALT_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 | |`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped |
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|`HYPR_T(kc)`|`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped |
|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped |
|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped |
|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped |
|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped |
|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped|
|`HYPR_T(kc)`|`ALL_T(kc)` |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)|
## [RGB Lighting](feature_rgblight.md) ## [RGB Lighting](feature_rgblight.md)

View file

@ -3,12 +3,13 @@
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define C(kc) LCTL(KC_##kc) #undef C
#undef S
#define C(kc) LCTL(KC_##kc)
#define S(kc) LSFT(KC_##kc)
#define RA(kc) RALT(KC_##kc) #define RA(kc) RALT(KC_##kc)
#define KC_SLCT KC_SELECT #define KC_SLCT KC_SELECT
#define MEDAPP LT(MEDIA, KC_APP) #define MEDAPP LT(MEDIA, KC_APP)
#undef S
#define S(kc) LSFT(KC_##kc)
uint8_t current_layer_global = 255; uint8_t current_layer_global = 255;

View file

@ -17,11 +17,15 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
/* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */ /* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */
#define G(kc) RALT(KC_##kc) /* Original shortcuts (quantum_keycodes.h) take full-sized keycodes: too long! */
#define A(kc) LALT(KC_##kc) #undef C
#undef S
#undef A
#undef G
#define C(kc) LCTL(KC_##kc) #define C(kc) LCTL(KC_##kc)
#undef S /* Original shortcut (quantum_keycodes.h) takes full-sized keycodes: too long! */
#define S(kc) LSFT(KC_##kc) #define S(kc) LSFT(KC_##kc)
#define A(kc) LALT(KC_##kc)
#define G(kc) RALT(KC_##kc)
#define CTALDEL LCTL(LALT(KC_DEL)) #define CTALDEL LCTL(LALT(KC_DEL))
enum layers { enum layers {

View file

@ -60,7 +60,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Fillers to make layering clearer // Fillers to make layering clearer
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define G(x) LGUI(x)
#define KC_WWWB KC_WWW_BACK #define KC_WWWB KC_WWW_BACK
#define KC_WWWF KC_WWW_FORWARD #define KC_WWWF KC_WWW_FORWARD

View file

@ -60,7 +60,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// Fillers to make layering clearer // Fillers to make layering clearer
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define G(x) LGUI(x)
#define KC_WWWB KC_WWW_BACK #define KC_WWWB KC_WWW_BACK
#define KC_WWWF KC_WWW_FORWARD #define KC_WWWF KC_WWW_FORWARD

View file

@ -10,10 +10,8 @@ enum pteron_layers {
#define LOWER MO(_LOWER) #define LOWER MO(_LOWER)
#define RAISE MO(_RAISE) #define RAISE MO(_RAISE)
// use S() to produce shifted versions of keys
// #define S(kc) LSFT(kc) // defined by default
// alt gr // alt gr
#undef G
#define G(kc) RALT(kc) #define G(kc) RALT(kc)
// custom keycodes // custom keycodes

View file

@ -4,9 +4,6 @@
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
#define G(X) LGUI(X)
#define A(X) LALT(X)
#define C(X) LCTL(X)
#define AC(X) A(C(X)) #define AC(X) A(C(X))
#define SC(X) S(C(X)) #define SC(X) S(C(X))
#define _______ KC_TRNS #define _______ KC_TRNS

View file

@ -9,7 +9,6 @@
// Keycode defines // Keycode defines
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#define C(kc) LCTL(kc)
// JIS keyboard // JIS keyboard
#define JK_CIRC KC_EQL // ^ #define JK_CIRC KC_EQL // ^
#define JK_AT KC_LBRC // @ #define JK_AT KC_LBRC // @

View file

@ -8,6 +8,7 @@ extern keymap_config_t keymap_config;
// Fillers to make layering more clear // Fillers to make layering more clear
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#undef C
#define C(n) RCTL(n) #define C(n) RCTL(n)
#define CADKEY RCTL(RALT(KC_DEL)) #define CADKEY RCTL(RALT(KC_DEL))

View file

@ -8,6 +8,7 @@ extern keymap_config_t keymap_config;
// Fillers to make layering more clear // Fillers to make layering more clear
#define _______ KC_TRNS #define _______ KC_TRNS
#define XXXXXXX KC_NO #define XXXXXXX KC_NO
#undef C
#define C(n) RCTL(n) #define C(n) RCTL(n)
#define CADKEY RCTL(RALT(KC_DEL)) #define CADKEY RCTL(RALT(KC_DEL))

View file

@ -567,9 +567,12 @@ enum quantum_keycodes {
#define FUNC(kc) (QK_FUNCTION | (kc)) #define FUNC(kc) (QK_FUNCTION | (kc))
// Aliases // Aliases
#define C(kc) LCTL(kc)
#define S(kc) LSFT(kc) #define S(kc) LSFT(kc)
#define F(kc) FUNC(kc) #define A(kc) LALT(kc)
#define G(kc) LGUI(kc)
#define F(kc) FUNC(kc)
#define M(kc) (QK_MACRO | (kc)) #define M(kc) (QK_MACRO | (kc))
#define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc)) #define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc))