Skip to content

Commit

Permalink
address bugs after 14.1, code scrub
Browse files Browse the repository at this point in the history
  • Loading branch information
moutis authored Sep 5, 2021
1 parent a9b110e commit 574b6cf
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 44 deletions.
14 changes: 7 additions & 7 deletions moutis.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@
My globals
*/
user_config_t user_config;
uint8_t saved_mods = 0; // to pass state between process_record_user and matrix_scan_user
uint16_t record_keycode = 0; // the keykcode we poke at in process_record

uint32_t linger_timer = 0; // time to hold a key before something else happens.
uint32_t state_reset_timer = 0; // time to leave a state active before shutting it down.
bool appmenu_on = false;
bool mods_held = false;
bool appmenu_on = false; // state of windows-like app switcher
bool mods_held = false; // nood to remember how we entered the appmenu state
bool key_trap = false; // used for shift BS = del (right)
uint8_t saved_mods = 0; // to pass state between process_record_user and matrix_scan_user
uint16_t record_keycode = 0; // the keykcode we poke at in process_record


uint8_t combo_on = 0; // for combo actions to hold before triggering
bool combo_triggered = false; // for one-shot-combo-actions


#include "moutis_semantics.c" // anything could send a semantic, so…first
#include "moutis_semantickeys.c" // anything could send a semantic, so…first

#ifdef OLED_DRIVER_ENABLE
#include "moutis_OLED.c"
Expand All @@ -56,9 +56,9 @@ const key_override_t **key_overrides = (const key_override_t *[]){
};
#endif

#include "moutis_casemods.c" // casemods could, theoretically send semantics, so define in order
#include "moutis_casemods.c"

#include "moutis_adaptives.c" // adaptives may send semantics, so …
#include "moutis_adaptivekeys.c"

#include "moutis_PROCESS_RECORD_hd_bronze.c"

Expand Down
2 changes: 1 addition & 1 deletion moutis.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

#include <quantum.h>

#include "moutis_semantics.h"
#include "moutis_semantickeys.h"

#include "moutis_casemods.h"

Expand Down
29 changes: 27 additions & 2 deletions moutis_COMBO_hd.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,33 @@ enum my_combos {
PC_BSPC, // <bksp> on num
PC_DEL, // <del> on num
PC_TAB, // <tab> on num
HC_TYPE_TION,
HC_TYPE_JAPAN,

// Fast entry 4grams
// since combos are a bit slower,
// needs to be a 4gram+ or more to be worth it
HC_ing_3gram, // TYPE "ing"
HC_tion_4gram, // TYPE "tion" #1
HC_with_4gram, // TYPE "with" #5
HC_ment_4gram, // TYPE "ment" #6
HC_this_4gram, // TYPE "this" #8
HC_here_4gram, // TYPE "here" #9
HC_ould_4gram, // TYPE "ould" #11
HC_ting_4gram, // TYPE "ting" #12
HC_sion_4gram, // TYPE "sion" #20
HC_they_4gram, // TYPE "they" #23
HC_ough_4gram, // TYPE "ough" #25


HC_their_5gram, // TYPE "their" #6
HC_there_5gram, // TYPE "there" #7
/*
HC_people_6gram, // TYPE "people" #23
HC_present_7gram, // TYPE "present" #1
HC_through_7gram, // TYPE "through" #3
HC_between_7gram, // TYPE "between" #4
*/

HC_TYPE_JAPAN, // TYPE "Japan" and hold for "ese"
HC_CAPSWORD, // CAPS WORD
FC_CAPS, // CAPS LOCK

Expand Down
166 changes: 140 additions & 26 deletions moutis_COMBO_hd_bronze.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const uint16_t PROGMEM F_KILL_combo[] = {KC_X, KC_W, COMBO_END}; // Force quit O
const uint16_t PROGMEM F_SCLP_combo[] = {KC_J, KC_V, COMBO_END}; // SCREEN shot SELECTION to clipboard
const uint16_t PROGMEM F_SCAP_combo[] = {KC_J, KC_K, COMBO_END}; // SCREEN shot SELECTION to file
const uint16_t PROGMEM F_CAPS_combo[] = {KC_D, KC_U, COMBO_END}; // CAPS LOCK (on until hit again)
//const uint16_t PROGMEM H_CAPS_combo[] = {LSFT_T(KC_BSPC), RSFT_T(KC_ENT), COMBO_END}; // CAPS WORD (on until delimiter)
const uint16_t PROGMEM H_CAPS_combo[] = {LSFT_T(KC_T), RSFT_T(KC_A), COMBO_END}; // CAPS WORD (on until delimiter)

// (22) keypad combos
Expand Down Expand Up @@ -72,12 +73,55 @@ const uint16_t PROGMEM Henye_combo[] = {KC_F, KC_P, COMBO_END}; // ˜ enye (dead

// LEFT HAND

// TEXT ENTRY (ANY ROW/ MIXED ROWS
// TEXT ENTRY - off map (ANY ROW/ MIXED ROWS) and row jump prevention
const uint16_t PROGMEM H_Z_combo[] = {KC_F, KC_M, COMBO_END}; // TYPE "z"
const uint16_t PROGMEM H_Q_combo[] = {KC_J, KC_F, COMBO_END}; // TYPE "q"
const uint16_t PROGMEM H_Q2_combo[] = {KC_U, KC_W, COMBO_END}; // TYPE "q"
const uint16_t PROGMEM H_LM_combo[] = {KC_M, KC_P, COMBO_END}; // TYPE "lp"
const uint16_t PROGMEM H_tion_combo[] = {LGUI_T(KC_N), LSFT_T(KC_T), COMBO_END}; // TYPE "tion"

const uint16_t PROGMEM H_ing_combo[] = {RALT_T(KC_I), KC_G, COMBO_END}; // TYPE "ing" only a 3gram, let's see it it's worth it

// Fast 4grams
// FOR THUMB SHIFT
/*
const uint16_t PROGMEM H_tion_combo[] = {LGUI_T(KC_N), LT(L_LANG_NUM, KC_T), COMBO_END}; // "tion" #1
const uint16_t PROGMEM H_with_combo[] = {KC_W, LSFT_T(KC_H), COMBO_END}; // "with" #5
const uint16_t PROGMEM H_ment_combo[] = {KC_M, LT(L_LANG_NUM, KC_T), COMBO_END}; // "ment" #6
const uint16_t PROGMEM H_this_combo[] = {LT(L_LANG_NUM, KC_T), LALT_T(KC_S), COMBO_END}; // "this" #8
const uint16_t PROGMEM H_here_combo[] = {LSFT(KC_H), RCTL_T(KC_R), COMBO_END}; // "here" #9
const uint16_t PROGMEM H_ould_combo[] = {KC_O, KC_D, COMBO_END}; // "ould" #11
const uint16_t PROGMEM H_ting_combo[] = {LT(L_LANG_NUM, KC_T), KC_G, COMBO_END}; // "ting" #12
const uint16_t PROGMEM H_sion_combo[] = {LALT_T(KC_S), LGUI_T(KC_N), COMBO_END}; // "sion" #20
const uint16_t PROGMEM H_they_combo[] = {LT(L_LANG_NUM, KC_T), KC_J, COMBO_END}; // "they" #23
const uint16_t PROGMEM H_their_combo[] = {LT(L_LANG_NUM, KC_T), KC_X, COMBO_END}; // "their" #6
const uint16_t PROGMEM H_there_combo[] = {LT(L_LANG_NUM, KC_T), LCTL_T(KC_R), COMBO_END}; // "there" #7
const uint16_t PROGMEM H_ough_combo[] = {KC_O, LSFT_T(KC_H), COMBO_END}; // "ough" #25
*/
// FOR INDEX SHIFT

const uint16_t PROGMEM H_tion_combo[] = {LGUI_T(KC_N), LSFT_T(KC_T), COMBO_END}; // "tion" #1
const uint16_t PROGMEM H_with_combo[] = {KC_W, LT(L_MEDIA_NAV,KC_H), COMBO_END}; // "with" #5
const uint16_t PROGMEM H_ment_combo[] = {KC_M, LSFT_T(KC_T), COMBO_END}; // "ment" #6
const uint16_t PROGMEM H_this_combo[] = {LSFT_T(KC_T), LALT_T(KC_S), COMBO_END}; // "this" #8
const uint16_t PROGMEM H_here_combo[] = {LT(L_MEDIA_NAV,KC_H), RGUI_T(KC_E), COMBO_END}; // "here" #9
const uint16_t PROGMEM H_ould_combo[] = {KC_O, KC_D, COMBO_END}; // "ould" #11
const uint16_t PROGMEM H_ting_combo[] = {LSFT_T(KC_T), KC_G, COMBO_END}; // "ting" #12
const uint16_t PROGMEM H_sion_combo[] = {LALT_T(KC_S), LGUI_T(KC_N), COMBO_END}; // "sion" #20
const uint16_t PROGMEM H_they_combo[] = {LSFT_T(KC_T), KC_Y, COMBO_END}; // "they" #23
const uint16_t PROGMEM H_ough_combo[] = {KC_O, LT(L_MEDIA_NAV,KC_H), COMBO_END}; // "ough" #25


// Fast 5-7grams

const uint16_t PROGMEM H_their_combo[] = {LSFT_T(KC_T), KC_X, COMBO_END}; // TYPE "their" #6
const uint16_t PROGMEM H_there_combo[] = {LSFT_T(KC_T), LCTL_T(KC_R), COMBO_END}; // TYPE "there" #7
/*const uint16_t PROGMEM H_people_combo[] = {KC_P, RGUI_T(KC_E), COMBO_END}; // TYPE "people" #23
const uint16_t PROGMEM H_present_combo[] = {KC_P, LSFT_T(KC_T), COMBO_END}; // TYPE "present" #1
const uint16_t PROGMEM H_through_combo[] = {LSFT_T(KC_T), LT(L_MEDIA_NAV,KC_H), COMBO_END}; // TYPE "through" #3
const uint16_t PROGMEM H_between_combo[] = {KC_B, LGUI_T(KC_N), COMBO_END}; // TYPE "between" #4
*/

/* other examples or text entry combos */
const uint16_t PROGMEM H_Japan_combo[] = {KC_J, KC_P, COMBO_END}; // TYPE "Japan"
const uint16_t PROGMEM Macro_combo[] = {KC_G, KC_F, COMBO_END}; // some macro placeholder

Expand All @@ -91,7 +135,7 @@ const uint16_t PROGMEM Hspc_combo[] = {KC_D, KC_B, COMBO_END}; // SPACE

// LOWER ROW

// SEMANTIC FUNCTIONS Spatially arranged
// SEMANTIC FUNCTIONS Spatially arranged ** uses SemKeys **
const uint16_t PROGMEM Hclose_combo[] = {KC_L, KC_B, COMBO_END}; // close
const uint16_t PROGMEM Hquit_combo[] = {KC_G, KC_B, COMBO_END}; // quit
const uint16_t PROGMEM Hfind_combo[] = {KC_F, KC_V, COMBO_END}; // find
Expand All @@ -106,7 +150,7 @@ const uint16_t PROGMEM Hpstm_combo[] = {KC_G, KC_D, COMBO_END}; // paste-match
const uint16_t PROGMEM Hdquo_combo[] = {KC_HASH, KC_QUOT, COMBO_END}; // "|" insert between double quote
const uint16_t PROGMEM Hdbrc_combo[] = {KC_MINS, KC_W, COMBO_END}; // [|] insert between double BRACKET

// Major diacritic combos
// Major diacritic combos will use SemKeys for platform independance
/*
const uint16_t PROGMEM HUM_combo[] = {KC_F, KC_U, COMBO_END}; // Ü
const uint16_t PROGMEM HOM_combo[] = {KC_F, KC_O, COMBO_END}; // Ö
Expand All @@ -117,9 +161,11 @@ const uint16_t PROGMEM HOV_combo[] = {KC_P, KC_O, COMBO_END}; // Ô
const uint16_t PROGMEM HUF_combo[] = {KC_V, KC_U, COMBO_END}; // Ú
const uint16_t PROGMEM HOF_combo[] = {KC_V, KC_O, COMBO_END}; // Ó
const uint16_t PROGMEM H1E_combo[] = {KC_P, KC_E, COMBO_END}; // É
const uint16_t PROGMEM H2E_combo[] = {KC_M, KC_E, COMBO_END}; // Ē
const uint16_t PROGMEM H3E_combo[] = {KC_P, KC_E, COMBO_END}; // Ê
const uint16_t PROGMEM HGRAV_E_combo[] = {LT(L_LANG_NUM, KC_T), KC_E, COMBO_END}; // É
const uint16_t PROGMEM HACUT_E_combo[] = {LGUI_T(KC_N), KC_E, COMBO_END}; // Ê
const uint16_t PROGMEM HDIER_E_combo[] = {LCTL_T(KC_S), KC_E, COMBO_END}; // Ë
const uint16_t PROGMEM HRING_E_combo[] = {LALT_T(KC_R), KC_E, COMBO_END}; // E̊
const uint16_t PROGMEM HMACR_E_combo[] = {KC_M, KC_E, COMBO_END}; // Ē
*/


Expand Down Expand Up @@ -214,11 +260,36 @@ combo_t key_combos[] = {
[HC_3E] = COMBO_ACTION(H3E_combo), // Ê
*/

[MYMACRO] = COMBO_ACTION(Macro_combo),
// Fast entry 4grams
[HC_ing_3gram] = COMBO_ACTION(H_ing_combo), // TYPE "ing"
[HC_tion_4gram] = COMBO_ACTION(H_tion_combo), // TYPE "tion" #1
[HC_with_4gram] = COMBO_ACTION(H_with_combo), // TYPE "with" #5
[HC_ment_4gram] = COMBO_ACTION(H_ment_combo), // TYPE "ment" #6
[HC_this_4gram] = COMBO_ACTION(H_this_combo), // TYPE "this" #8
[HC_here_4gram] = COMBO_ACTION(H_here_combo), // TYPE "here" #9
[HC_ould_4gram] = COMBO_ACTION(H_ould_combo), // TYPE "ould" #11
[HC_ting_4gram] = COMBO_ACTION(H_ting_combo), // TYPE "ting" #12
[HC_sion_4gram] = COMBO_ACTION(H_sion_combo), // TYPE "sion" #20
[HC_they_4gram] = COMBO_ACTION(H_they_combo), // TYPE "they" #23
[HC_ough_4gram] = COMBO_ACTION(H_ough_combo), // TYPE "ough" #25

// Fast entry 5-7grams

[HC_their_5gram] = COMBO_ACTION(H_their_combo), // TYPE "their" #6
[HC_there_5gram] = COMBO_ACTION(H_there_combo), // TYPE "there" #7

/*
[HC_people_6gram] = COMBO_ACTION(H_people_combo), // TYPE "people" #23
[HC_present_7gram] = COMBO_ACTION(H_present_combo), // TYPE "present" #1
[HC_through_7gram] = COMBO_ACTION(H_through_combo), // TYPE "through" #3
[HC_between_7gram] = COMBO_ACTION(H_between_combo), // TYPE "between" #4
*/

[HC_TYPE_LM] = COMBO_ACTION(H_LM_combo),
[HC_TYPE_TION] = COMBO_ACTION(H_tion_combo),
[HC_TYPE_JAPAN] = COMBO_ACTION(H_Japan_combo),
[HC_TYPE_JAPAN] = COMBO_ACTION(H_Japan_combo), // a personally useful 5-8gram!
[MYMACRO] = COMBO_ACTION(Macro_combo), // a demonstrator, how long autotypes can be!

/* Uses SemKeys */
// [HC_APP] = COMBO(Happ_combo, KC_APP), // app menu
[HC_SPC] = COMBO(Hspc_combo, KC_SPC), // SPACE
[HC_ENT] = COMBO(Hent_combo, KC_ENT), // ENTER
Expand Down Expand Up @@ -256,9 +327,64 @@ void process_combo_event(uint16_t combo_index, bool pressed) {
case HC_MDSH:
register_code16(A(S(KC_MINS)));
break;
case HC_TYPE_TION:


case HC_ing_3gram: // TYPE "ing"
SEND_STRING("ing");
break;
case HC_tion_4gram: // TYPE "tion" #1
SEND_STRING("tion");
break;
case HC_with_4gram: // TYPE "with" #5
SEND_STRING("with");
break;
case HC_ment_4gram: // TYPE "ment" #6
SEND_STRING("ment");
break;
case HC_this_4gram: // TYPE "this" #8
SEND_STRING("this");
break;
case HC_here_4gram: // TYPE "here" #9
SEND_STRING("here");
break;
case HC_ould_4gram: // TYPE "ould" #11
SEND_STRING("ould");
break;
case HC_ting_4gram: // TYPE "ting" #12
SEND_STRING("ting");
break;
case HC_sion_4gram: // TYPE "sion" #20
SEND_STRING("sion");
break;
case HC_they_4gram: // TYPE "they" #23
SEND_STRING("they");
break;
case HC_ough_4gram: // TYPE "ough" #25
SEND_STRING("ough");
break;

case HC_their_5gram: // TYPE "their" #6
SEND_STRING("their");
break;
case HC_there_5gram: // TYPE "there" #7
SEND_STRING("there");
break;
/*
case HC_people_6gram: // TYPE "people" #23
SEND_STRING("people");
break;
case HC_present_7gram: // TYPE "present" #1
SEND_STRING("present");
break;
case HC_through_7gram: // TYPE "through" #3
SEND_STRING("through");
break;
case HC_between_7gram: // TYPE "between" #4
SEND_STRING("between");
break;
*/


case HC_TYPE_JAPAN:
SEND_STRING("Japan"); // send "Japan" right away
combo_on = combo_index; // may add "ese" in matrix_scan_user_process_combo
Expand Down Expand Up @@ -391,7 +517,7 @@ void process_combo_event(uint16_t combo_index, bool pressed) {
break;
} // end switch(combo_index) {
} else {
// Key up, threshold met, so we'll resolve the combo action if neccessary.
// Key up, threshold met, so we'll WRAP-UP the combo action if neccessary.
// unregister_code for repeating keys, etc. that weren't handled in matrix_scan_user
switch(combo_index) {
case HC_NDSH:
Expand Down Expand Up @@ -586,7 +712,7 @@ extern uint8_t saved_mods; // global, so we're not wasting time allocating...
tap_code16(KC_E);
break;
*/

case MYMACRO:
SEND_STRING("End of times in 2020\n");
break;
Expand Down Expand Up @@ -618,29 +744,17 @@ extern uint8_t saved_mods; // global, so we're not wasting time allocating...

case HC_CLOZ:
register_SemKey(SK_CLOZ);
// register_code16(G(KC_W));
break;
case HC_QUIT:
register_SemKey(SK_QUIT);
// register_code16(G(KC_Q));
break;
case HC_FIND: // Find the selection
tap_SemKeys(SK_COPY);
tap_SemKeys(SK_FIND);
tap_SemKeys(SK_PSTE);
case HC_SALL:
tap_SemKeys(SK_SALL);
/*
#ifdef OLED_DRIVER_ENABLE
oled_set_cursor(6, combo_OLED_row-1);
itoa(((SymanticCombos[SK_SALL][OSIndex])>>8),OLEDline,2);
oled_write(OLEDline, true);
oled_set_cursor(6, combo_OLED_row);
oled_write_char((char) (0x61+(0xff & SymanticCombos[SK_SALL][OSIndex])), false);
oled_write_char((char) SK_SALL+48, true);
oled_write_char((char) OSIndex+48, true);
#endif
*/


break;
case HC_UNDO:
Expand Down
Loading

0 comments on commit 574b6cf

Please sign in to comment.