X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=docs%2Ffeature_combo.md;h=4cb1bcda0832b92a652b5ef708a5919bfbac584e;hb=7f23ad72c5c736b58bab16995e7b0a599268b56f;hp=5bb73ef106772018494c9001f61f6d3e27809722;hpb=d3a6296199c6f6564e0fffd6d7c1355496d9feac;p=qmk_firmware.git diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 5bb73ef10..4cb1bcda0 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -19,7 +19,6 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; This will send "Escape" if you hit the A and B keys. !> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. -!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo. ## Examples @@ -29,7 +28,8 @@ If you want to add a list, then you'd use something like this: enum combos { AB_ESC, JK_TAB -} +}; + const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; @@ -44,15 +44,15 @@ For a more complicated implementation, you can use the `process_combo_event` fun ```c enum combo_events { ZC_COPY, - ZV_PASTE - }; + XV_PASTE +}; const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; combo_t key_combos[COMBO_COUNT] = { [ZC_COPY] = COMBO_ACTION(copy_combo), - [ZV_PASTE] = COMBO_ACTION(paste_combo), + [XV_PASTE] = COMBO_ACTION(paste_combo), }; void process_combo_event(uint8_t combo_index, bool pressed) { @@ -66,7 +66,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } break; - case ZV_PASTE: + case XV_PASTE: if (pressed) { register_code(KC_LCTL); register_code(KC_V); @@ -78,7 +78,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } ``` -This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit X and V. But you could change this to do stuff like change layers, play sounds, or change settings. ## Additional Configuration