Skip to content

Commit

Permalink
refactor ngrams layer to allow easy access to z and x, and remove com…
Browse files Browse the repository at this point in the history
…bos for them
  • Loading branch information
rafaelromao committed Sep 25, 2022
1 parent f4feb4f commit 53df21b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 35 deletions.
Binary file modified img/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/qmk/users/rafaelromao/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define LEADER_NO_TIMEOUT

// Configure combos
#define COMBO_COUNT 42
#define COMBO_COUNT 40
#define COMBO_TERM 30
#define EXTRA_SHORT_COMBOS
#define COMBO_STRICT_TIMER
Expand Down
9 changes: 4 additions & 5 deletions src/qmk/users/rafaelromao/definitions/keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,17 @@ enum {

STR_MACRO_START,

MC_BTIC, MC_DQUO, MC_SQUO,
MC_CIRC, MC_TILD, MC_DEG, MC_DAND, MC_DPIP,
MC_BTIC, MC_DQUO, MC_SQUO, MC_DEG,
MC_CIRC, MC_TILD, MC_DAND, MC_DPIP,

MC_GV_A, MC_CR_A, MC_TL_A, MC_SQ_A,
MC_SQ_U, MC_CR_O, MC_SQ_O, MC_SQ_I,
MC_CR_E, MC_TL_O, MC_SQ_C, MC_SQ_E,

MC_QU, MC_LH, MC_PH,
MC_LH, MC_PH,
MC_CH, MC_TH, MC_WH,
MC_GH, MC_NH, MC_SH,
MC_I, MC_NT, MC_BY,
MC_CK, MC_ING,
MC_I, MC_NT, MC_NG,

MC_AO, MC_CAO, MC_OES, MC_COES,

Expand Down
4 changes: 2 additions & 2 deletions src/qmk/users/rafaelromao/definitions/keymap_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

#define ___________________NGRAMS_L1___________________ XXXXXXX , MC_SQ_C , MC_SQUO , MC_WH , XXXXXXX
#define ___________________NGRAMS_L2___________________ MC_LH , MC_NH , MC_SH , MC_TH , MC_GH
#define ___________________NGRAMS_L3___________________ MC_QU , MC_BY , MC_CH , MC_PH , MC_CK
#define ___________________NGRAMS_L3___________________ XXXXXXX , MC_NG , MC_CH , MC_PH , KC_Z
#define ____NGRAMS_L4____ _______ , KC_SPC

#define ___________________NGRAMS_R1___________________ XXXXXXX , MC_TL_O , MC_SQ_O , MC_SQ_U , XXXXXXX
#define ___________________NGRAMS_R2___________________ MC_GV_A , MC_TL_A , MC_SQ_A , MC_SQ_E , MC_SQ_I
#define ___________________NGRAMS_R3___________________ XXXXXXX , MC_CR_A , MC_CR_O , MC_CR_E , MC_ING
#define ___________________NGRAMS_R3___________________ KC_X , MC_CR_A , MC_CR_O , MC_CR_E , XXXXXXX
#define ____NGRAMS_R4____ KC_BSPC , _______

#define ___________________NUMPAD_L1___________________ XXXXXXX , KC_F9 , KC_F8 , KC_F7 , KC_F12
Expand Down
30 changes: 14 additions & 16 deletions src/qmk/users/rafaelromao/features/combos.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const uint16_t PROGMEM r_mac_ref_combo[] = {MC_SWLE, MC_SWRI, COMBO_END};

// Base

const uint16_t PROGMEM l_rom_z_combo[] = {KC_C, LGUIT_P, COMBO_END};
const uint16_t PROGMEM l_rom_esc_combo[] = {LOW_SPC, KC_F, KC_D, COMBO_END};
const uint16_t PROGMEM l_rom_sal_combo[] = {LOW_SPC, KCL_MAC, LSFTT_N, COMBO_END};
const uint16_t PROGMEM l_rom_rai_combo[] = {LOW_SPC, LSFTT_N, COMBO_END};
Expand All @@ -52,7 +51,6 @@ const uint16_t PROGMEM l_rom_pas_combo[] = {LOW_SPC, LCTLT_S, LALTT_T, COMBO_END
const uint16_t PROGMEM l_rom_und_combo[] = {LOW_SPC, KC_Q, KC_B, COMBO_END};
const uint16_t PROGMEM l_rom_cop_combo[] = {LOW_SPC, KC_C, LGUIT_P, COMBO_END};

const uint16_t PROGMEM r_rom_x_combo[] = {RGUIT_M, TD_COMM, COMBO_END};
const uint16_t PROGMEM r_rom_tab_combo[] = {RAI_BSP, KC_O, KC_U, COMBO_END};
const uint16_t PROGMEM r_rom_pas_combo[] = {RAI_BSP, RALTT_R, RCTLT_A, COMBO_END};
const uint16_t PROGMEM r_rom_ent_combo[] = {RAI_BSP, RCTLT_A, RSFTT_E, COMBO_END};
Expand All @@ -73,18 +71,18 @@ const uint16_t PROGMEM rom_reset_combo[] = {KCL_MAC, KC_Q, KCI_MAC, KC_Y, COMBO_
const uint16_t PROGMEM secret_1_combo[] = {SEC_1, SEC_2, SEC_3, SEC_4, COMBO_END};

combo_t key_combos[COMBO_COUNT] = {
COMBO(l_rom_z_combo, KC_Z), COMBO(r_rom_x_combo, KC_X), COMBO(l_num_esc_combo, KC_ESC),
COMBO(l_num_sav_combo, MC_SAVE), COMBO(r_num_ent_combo, KC_ENT), COMBO(l_low_par_combo, TD_PARN),
COMBO(r_low_tab_combo, KC_TAB), COMBO(r_low_ent_combo, KC_ENT), COMBO(r_ng_i_combo, MC_I),
COMBO(r_ng_nt_combo, MC_NT), COMBO(r_ng_ao_combo, MC_AO), COMBO(r_ng_cao_combo, MC_CAO),
COMBO(r_ng_oes_combo, MC_OES), COMBO(r_ng_coes_combo, MC_COES), COMBO(r_mac_ref_combo, MC_REF),
COMBO(r_rom_cop_combo, MC_COPY), COMBO(r_rom_sco_combo, TD_SCLE), COMBO(l_rom_usc_combo, KC_UNDS),
COMBO(l_rom_sal_combo, MC_SELC), COMBO(r_rom_pas_combo, MC_PAST), COMBO(l_rom_rai_combo, OS_RAI),
COMBO(l_rom_low_combo, OS_LOW), COMBO(l_rom_sav_combo, MC_SAVE), COMBO(l_rom_pas_combo, MC_PAST),
COMBO(l_rom_esc_combo, KC_ESC), COMBO(r_rom_fin_combo, MC_FIND), COMBO(r_rom_sce_combo, MC_SENT),
COMBO(l_rom_und_combo, MC_UNDO), COMBO(l_rom_cop_combo, MC_COPY), COMBO(r_rom_tab_combo, KC_TAB),
COMBO(r_rom_low_combo, OS_LOW), COMBO(r_rom_rai_combo, OS_RAI), COMBO(r_rom_ent_combo, KC_ENT),
COMBO(r_rom_ful_combo, MC_FULL), COMBO(r_med_hom_combo, KC_HOME), COMBO(r_med_end_combo, KC_END),
COMBO(r_rai_cur_combo, MC_CUR), COMBO(r_med_del_combo, KC_DEL), COMBO(r_med_ins_combo, KC_INS),
COMBO(r_med_ent_combo, TD_EENT), COMBO(rom_reset_combo, QK_BOOT), COMBO(secret_1_combo, MC_SECRET_1),
COMBO(l_num_esc_combo, KC_ESC), COMBO(l_num_sav_combo, MC_SAVE), COMBO(r_num_ent_combo, KC_ENT),
COMBO(l_low_par_combo, TD_PARN), COMBO(r_low_tab_combo, KC_TAB), COMBO(r_low_ent_combo, KC_ENT),
COMBO(r_ng_i_combo, MC_I), COMBO(r_ng_nt_combo, MC_NT), COMBO(r_ng_ao_combo, MC_AO),
COMBO(r_ng_cao_combo, MC_CAO), COMBO(r_ng_oes_combo, MC_OES), COMBO(r_ng_coes_combo, MC_COES),
COMBO(r_mac_ref_combo, MC_REF), COMBO(r_rom_cop_combo, MC_COPY), COMBO(r_rom_sco_combo, TD_SCLE),
COMBO(l_rom_usc_combo, KC_UNDS), COMBO(l_rom_sal_combo, MC_SELC), COMBO(r_rom_pas_combo, MC_PAST),
COMBO(l_rom_rai_combo, OS_RAI), COMBO(l_rom_low_combo, OS_LOW), COMBO(l_rom_sav_combo, MC_SAVE),
COMBO(l_rom_pas_combo, MC_PAST), COMBO(l_rom_esc_combo, KC_ESC), COMBO(r_rom_fin_combo, MC_FIND),
COMBO(r_rom_sce_combo, MC_SENT), COMBO(l_rom_und_combo, MC_UNDO), COMBO(l_rom_cop_combo, MC_COPY),
COMBO(r_rom_tab_combo, KC_TAB), COMBO(r_rom_low_combo, OS_LOW), COMBO(r_rom_rai_combo, OS_RAI),
COMBO(r_rom_ent_combo, KC_ENT), COMBO(r_rom_ful_combo, MC_FULL), COMBO(r_med_hom_combo, KC_HOME),
COMBO(r_med_end_combo, KC_END), COMBO(r_rai_cur_combo, MC_CUR), COMBO(r_med_del_combo, KC_DEL),
COMBO(r_med_ins_combo, KC_INS), COMBO(r_med_ent_combo, TD_EENT), COMBO(rom_reset_combo, QK_BOOT),
COMBO(secret_1_combo, MC_SECRET_1),
};
13 changes: 2 additions & 11 deletions src/qmk/users/rafaelromao/features/ngrams.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,6 @@ process_record_result_t process_ngrams_keycode(uint16_t keycode, bool isShifted)

// N-Grams

case MC_QU:
SEND_STRING("qu");
return PROCESS_RECORD_RETURN_FALSE;
case MC_LH:
SEND_STRING("lh");
return PROCESS_RECORD_RETURN_FALSE;
Expand All @@ -171,13 +168,7 @@ process_record_result_t process_ngrams_keycode(uint16_t keycode, bool isShifted)
case MC_WH:
SEND_STRING("wh");
return PROCESS_RECORD_RETURN_FALSE;
case MC_BY:
SEND_STRING("by");
return PROCESS_RECORD_RETURN_FALSE;

case MC_CK:
SEND_STRING("ck");
return PROCESS_RECORD_RETURN_FALSE;
case MC_CH:
SEND_STRING("ch");
return PROCESS_RECORD_RETURN_FALSE;
Expand All @@ -194,8 +185,8 @@ process_record_result_t process_ngrams_keycode(uint16_t keycode, bool isShifted)
case MC_NT:
SEND_STRING("n't");
return PROCESS_RECORD_RETURN_FALSE;
case MC_ING:
SEND_STRING("ing");
case MC_NG:
SEND_STRING("ng");
return PROCESS_RECORD_RETURN_FALSE;
}

Expand Down

0 comments on commit 53df21b

Please sign in to comment.