Keymap introspection for combos. (#19670)
This commit is contained in:
parent
433dc60686
commit
5faa23d54c
226 changed files with 533 additions and 729 deletions
|
@ -17,3 +17,4 @@ CAPS_WORD_ENABLE = yes
|
|||
COMBO_ENABLE = yes
|
||||
AUTO_SHIFT_ENABLE = yes
|
||||
|
||||
INTROSPECTION_KEYMAP_C = test_combos.c
|
||||
|
|
|
@ -38,29 +38,6 @@ using ::testing::AnyOf;
|
|||
using ::testing::InSequence;
|
||||
using ::testing::TestParamInfo;
|
||||
|
||||
extern "C" {
|
||||
// Define some combos to use for the test, including overlapping combos and
|
||||
// combos that chord tap-hold keys.
|
||||
enum combo_events { AB_COMBO, BC_COMBO, AD_COMBO, DE_COMBO, FGHI_COMBO, COMBO_LENGTH };
|
||||
uint16_t COMBO_LEN = COMBO_LENGTH;
|
||||
|
||||
const uint16_t ab_combo[] PROGMEM = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t bc_combo[] PROGMEM = {KC_B, KC_C, COMBO_END};
|
||||
const uint16_t ad_combo[] PROGMEM = {KC_A, LCTL_T(KC_D), COMBO_END};
|
||||
const uint16_t de_combo[] PROGMEM = {LCTL_T(KC_D), LT(1, KC_E), COMBO_END};
|
||||
const uint16_t fghi_combo[] PROGMEM = {KC_F, KC_G, KC_H, KC_I, COMBO_END};
|
||||
|
||||
// clang-format off
|
||||
combo_t key_combos[] = {
|
||||
[AB_COMBO] = COMBO(ab_combo, KC_SPC), // KC_A + KC_B = KC_SPC
|
||||
[BC_COMBO] = COMBO(bc_combo, KC_X), // KC_B + KC_C = KC_X
|
||||
[AD_COMBO] = COMBO(ad_combo, KC_Y), // KC_A + LCTL_T(KC_D) = KC_Y
|
||||
[DE_COMBO] = COMBO(de_combo, KC_Z), // LCTL_T(KC_D) + LT(1, KC_E) = KC_Z
|
||||
[FGHI_COMBO] = COMBO(fghi_combo, KC_W) // KC_F + KC_G + KC_H + KC_I = KC_W
|
||||
};
|
||||
// clang-format on
|
||||
} // extern "C"
|
||||
|
||||
namespace {
|
||||
|
||||
// To test combos thorougly, we test them with pressing the chord keys with
|
||||
|
|
20
tests/caps_word/caps_word_combo/test_combos.c
Normal file
20
tests/caps_word/caps_word_combo/test_combos.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include <quantum.h>
|
||||
|
||||
// Define some combos to use for the test, including overlapping combos and
|
||||
// combos that chord tap-hold keys.
|
||||
enum combo_events { AB_COMBO, BC_COMBO, AD_COMBO, DE_COMBO, FGHI_COMBO };
|
||||
|
||||
const uint16_t ab_combo[] PROGMEM = {KC_A, KC_B, COMBO_END};
|
||||
const uint16_t bc_combo[] PROGMEM = {KC_B, KC_C, COMBO_END};
|
||||
const uint16_t ad_combo[] PROGMEM = {KC_A, LCTL_T(KC_D), COMBO_END};
|
||||
const uint16_t de_combo[] PROGMEM = {LCTL_T(KC_D), LT(1, KC_E), COMBO_END};
|
||||
const uint16_t fghi_combo[] PROGMEM = {KC_F, KC_G, KC_H, KC_I, COMBO_END};
|
||||
|
||||
// clang-format off
|
||||
combo_t key_combos[] = {
|
||||
[AB_COMBO] = COMBO(ab_combo, KC_SPC), // KC_A + KC_B = KC_SPC
|
||||
[BC_COMBO] = COMBO(bc_combo, KC_X), // KC_B + KC_C = KC_X
|
||||
[AD_COMBO] = COMBO(ad_combo, KC_Y), // KC_A + LCTL_T(KC_D) = KC_Y
|
||||
[DE_COMBO] = COMBO(de_combo, KC_Z), // LCTL_T(KC_D) + LT(1, KC_E) = KC_Z
|
||||
[FGHI_COMBO] = COMBO(fghi_combo, KC_W) // KC_F + KC_G + KC_H + KC_I = KC_W
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue