From c44fc68297029da87233777aff6978d39caebbb1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Jul 2019 01:37:19 -0700 Subject: Allow Combo feature to be enabled/disabled live (#6318) * Add ability to enable/disable combos * Update documentation for Combo feature * Change keycodes for appeasement * Simplify combo_toggle function * Update names * Update combo docs to use tables --- docs/feature_combo.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'docs/feature_combo.md') diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 4cb1bcda0..9db7be511 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -59,19 +59,12 @@ void process_combo_event(uint8_t combo_index, bool pressed) { switch(combo_index) { case ZC_COPY: if (pressed) { - register_code(KC_LCTL); - register_code(KC_C); - unregister_code(KC_C); - unregister_code(KC_LCTL); + tap_code16(LCTL(KC_C)); } break; - case XV_PASTE: if (pressed) { - register_code(KC_LCTL); - register_code(KC_V); - unregister_code(KC_V); - unregister_code(KC_LCTL); + tap_code16(LCTL(KC_V)); } break; } @@ -87,3 +80,24 @@ If you're using long combos, or even longer combos, you may run into issues with In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file. You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`. + +## 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. + +|Keycode |Description | +|----------|---------------------------------| +|`CMB_ON` |Turns on Combo feature | +|`CMB_OFF` |Turns off Combo feature | +|`CMB_TOG` |Toggles Combo feature on and off | + +## User callbacks + +In addition to the keycodes, there are a few functions that you can use to set the status, or check it: + +|Function |Description | +|-----------|--------------------------------------------------------------------| +| `combo_enable()` | Enables the combo feature | +| `combo_disable()` | Disables the combo feature, and clears the combo buffer | +| `combo_toggle()` | Toggles the state of the combo feature | +| `is_combo_enabled()` | Returns the status of the combo feature state (true or false) | -- cgit v1.2.3-70-g09d2 From 57540af102d034396c9f41a5a6e69ead8b10ba99 Mon Sep 17 00:00:00 2001 From: Michael Clayton Date: Thu, 8 Aug 2019 13:10:16 -0400 Subject: Change "yu" to "you" in combo docs (#6510) --- docs/feature_combo.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/feature_combo.md') diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 9db7be511..d3eb896b2 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -2,7 +2,7 @@ The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks. -To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`. +To enable this feature, you need to add `COMBO_ENABLE = yes` to your `rules.mk`. Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using). -- cgit v1.2.3-70-g09d2