Normalise Combo keycodes (#18877)
This commit is contained in:
parent
8436f0dfa6
commit
efe520645e
|
@ -105,11 +105,11 @@ It is worth noting that `COMBO_ACTION`s are not needed anymore. As of [PR#8591](
|
|||
## Keycodes
|
||||
You can enable, disable and toggle the Combo feature on the fly. This is useful if you need to disable them temporarily, such as for a game. The following keycodes are available for use in your `keymap.c`
|
||||
|
||||
|Keycode |Description |
|
||||
|----------|---------------------------------|
|
||||
|`CMB_ON` |Turns on Combo feature |
|
||||
|`CMB_OFF` |Turns off Combo feature |
|
||||
|`CMB_TOG` |Toggles Combo feature on and off |
|
||||
|Keycode |Aliases |Description |
|
||||
|-----------------|---------|--------------------------------|
|
||||
|`QK_COMBO_ON` |`CM_ON` |Turns on Combo feature |
|
||||
|`QK_COMBO_OFF` |`CM_OFF` |Turns off Combo feature |
|
||||
|`QK_COMBO_TOGGLE`|`CM_TOGG`|Toggles Combo feature on and off|
|
||||
|
||||
# Advanced Configuration
|
||||
These configuration settings can be set in your `config.h` file.
|
||||
|
|
|
@ -97,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_NO, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, KC_TILD, KC_TRNS, KC_TRNS, KC_BSLS, KC_NO,
|
||||
KC_NO, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_QUOT, KC_NO,
|
||||
KC_NO, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_MINS, KC_NO,
|
||||
CMB_TOG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL
|
||||
CM_TOGG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL
|
||||
),
|
||||
|
||||
/* Keymap 2: Pad/Function layer
|
||||
|
|
|
@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, KC_TILD, KC_TRNS, KC_TRNS, KC_BSLS,
|
||||
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_QUOT,
|
||||
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_MINS,
|
||||
CMB_TOG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL),
|
||||
CM_TOGG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL),
|
||||
|
||||
/* Keymap 2: Numbers/Function/Motion layer
|
||||
*
|
||||
|
|
|
@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, KC_TILD, KC_TRNS, KC_TRNS, KC_BSLS,
|
||||
KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_QUOT,
|
||||
KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_MINS,
|
||||
CMB_TOG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL),
|
||||
CM_TOGG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL),
|
||||
|
||||
/* Keymap 2: Numbers/Function/Motion layer
|
||||
*
|
||||
|
|
|
@ -56,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD,
|
||||
KC_TRNS, RGB_TOG, KC_TRNS, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD,
|
||||
BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CMB_TOG, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, CM_TOGG, BL_TOGG, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_MUTE),
|
||||
|
||||
[2] = LAYOUT(
|
||||
|
@ -133,7 +133,7 @@ void post_process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|||
switch (keycode) {
|
||||
case KC_CAPS:
|
||||
case KC_MUTE:
|
||||
case CMB_TOG:
|
||||
case QK_COMBO_TOGGLE:
|
||||
if (record->event.pressed) {
|
||||
rgblight_blink_layer(4, 250);
|
||||
}
|
||||
|
|
|
@ -531,17 +531,17 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
|
|||
bool is_combo_key = false;
|
||||
bool no_combo_keys_pressed = true;
|
||||
|
||||
if (keycode == CMB_ON && record->event.pressed) {
|
||||
if (keycode == QK_COMBO_ON && record->event.pressed) {
|
||||
combo_enable();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keycode == CMB_OFF && record->event.pressed) {
|
||||
if (keycode == QK_COMBO_OFF && record->event.pressed) {
|
||||
combo_disable();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (keycode == CMB_TOG && record->event.pressed) {
|
||||
if (keycode == QK_COMBO_TOGGLE && record->event.pressed) {
|
||||
combo_toggle();
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -408,9 +408,9 @@ enum quantum_keycodes {
|
|||
QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE, // 5CF7
|
||||
|
||||
// Combos
|
||||
CMB_ON, // 5CF8
|
||||
CMB_OFF, // 5CF9
|
||||
CMB_TOG, // 5CFA
|
||||
QK_COMBO_ON, // 5CF8
|
||||
QK_COMBO_OFF, // 5CF9
|
||||
QK_COMBO_TOGGLE, // 5CFA
|
||||
|
||||
// Magic (continued)
|
||||
MAGIC_SWAP_LCTL_LGUI, // 5CFB
|
||||
|
@ -872,6 +872,11 @@ enum quantum_keycodes {
|
|||
#define SC_RAPC QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE
|
||||
#define SC_SENT QK_SPACE_CADET_RIGHT_SHIFT_ENTER
|
||||
|
||||
// Combos
|
||||
#define CM_ON QK_COMBO_ON
|
||||
#define CM_OFF QK_COMBO_OFF
|
||||
#define CM_TOGG QK_COMBO_TOGGLE
|
||||
|
||||
// Swap Hands
|
||||
#define SH_T(kc) (QK_SWAP_HANDS | (kc))
|
||||
#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
#define ONESHOT_DISABLE QK_ONE_SHOT_OFF
|
||||
#define ONESHOT_TOGGLE QK_ONE_SHOT_TOGGLE
|
||||
|
||||
#define CMB_ON QK_COMBO_ON
|
||||
#define CMB_OFF QK_COMBO_OFF
|
||||
#define CMB_TOG QK_COMBO_TOGGLE
|
||||
|
||||
#define PROGRAMMABLE_BUTTON_1 QK_PROGRAMMABLE_BUTTON_1
|
||||
#define PROGRAMMABLE_BUTTON_2 QK_PROGRAMMABLE_BUTTON_2
|
||||
#define PROGRAMMABLE_BUTTON_3 QK_PROGRAMMABLE_BUTTON_3
|
||||
|
|
Loading…
Reference in a new issue