Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalise Combo keycodes #18877

Merged
merged 1 commit into from
Oct 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/feature_combo.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion keyboards/centromere/keymaps/mini_bom/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion keyboards/gboards/gergoplex/keymaps/colemak-dhm/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion keyboards/gboards/gergoplex/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
4 changes: 2 additions & 2 deletions keyboards/ymdk/melody96/keymaps/dvz/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
}
Expand Down
6 changes: 3 additions & 3 deletions quantum/process_keycode/process_combo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
11 changes: 8 additions & 3 deletions quantum/quantum_keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -871,6 +871,11 @@ enum quantum_keycodes {
#define SC_LAPO QK_SPACE_CADET_LEFT_ALT_PARENTHESIS_OPEN
#define SC_RAPC QK_SPACE_CADET_RIGHT_ALT_PARENTHESIS_CLOSE

// 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)
Expand Down
4 changes: 4 additions & 0 deletions quantum/quantum_keycodes_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down