Skip to content

Commit

Permalink
Summer update
Browse files Browse the repository at this point in the history
The latest tweaks, mostly to adaptives (they are the result of extended real-world trials), some bug fixes (App_Menu), and comma_cap.
  • Loading branch information
moutis authored Jun 10, 2024
1 parent 9d75d43 commit 3110faf
Show file tree
Hide file tree
Showing 13 changed files with 273 additions and 121 deletions.
53 changes: 37 additions & 16 deletions handsdown/vb-adaptive.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {

// switch (((keycode >= SAFE_RANGE) && (keycode <= SemKeys_COUNT)) ? (keycode) : (keycode & QK_BASIC_MAX)) { // only handling normal, SHFT or ALT cases.

switch (keycode & QK_BASIC_MAX) { // process ignoring multi-function keys & shift state?

switch (keycode) { // process ignoring multi-function keys & shift state?
/*
// Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits)
*/
Expand Down Expand Up @@ -71,10 +70,12 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {
tap_code(KC_L); // pull up "L" (PL is 15x more common than PM)
return_state = false; // done.
break;
/*
case KC_B: // to avoid the scissor on BM
tap_code(KC_M);
return_state = false; // done.
break;
*/
case KC_L:
if (preprior_keycode == KC_P) { // PLD = PWD?
tap_code(KC_BSPC);
Expand Down Expand Up @@ -220,29 +221,39 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {
tap_code(KC_D); // eliminate SFB on index
return_state = false; // done.
break;
case KC_N: // avoid SFB (NL is 10x more common than NW)
tap_code(KC_L);
return_state = false; // done.
break;
}
break;

case KC_K: // remedy ring-index split by shifting fingering
if (prior_keycode == KC_T) { // TK = CK (>282x)
tap_code(KC_BSPC);
// remedy ring-index split by shifting fingering
// Since the hand is already displaced to reach the inner column,
// pull the L over with alternate fingering to avoid the stretch.
case KC_K:
switch (prior_keycode) {
case KC_T: // TK = CK (CK is 252x more common than TK))
tap_code(KC_BSPC); // replace T
tap_code(KC_C);
break;
break; // Send K normally
case KC_D:
case KC_G:
tap_code(KC_BSPC); // replace D/G
tap_code(KC_L);
break; // Send K normally
}
// falling through here intentionally here. V&K are treated same.
break;
case KC_V: // remedy inner column split by shifting fingering
switch (prior_keycode) {
case KC_D: // TV/DV/GV = LV ()
// case KC_D: // TV/DV/GV = LV ()
// case KC_G: //

case KC_T: // TK/DK/GK = LK ()
case KC_G: //
tap_code(KC_BSPC);
tap_code(KC_L);
break; // and let current keycode send normally
case KC_B: //
tap_code(KC_M);
return_state = false; // done.
break; // and let current keycode send normally
}
}
break;

/*
Expand All @@ -265,6 +276,10 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {
tap_code(KC_T); // eliminate GT SFB.
return_state = false; // done.
break;
case KC_N: // avoid SFB (NL is 23x more common than NX)
tap_code(KC_L);
return_state = false; // done.
break;
}
break;

Expand Down Expand Up @@ -343,10 +358,16 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {
return_state = false; // done.
break;
#endif
case KC_I: // IF = IY (eliminate SFB on ring finger)
tap_code(KC_Y); // (inverted IH->IF = IF->IY)
return_state = false; // done.
break;
/*
case KC_I: // avoid row skip on outward pinky roll
tap_code(KC_F); // "IH" yields "IF" (96x more common)
tap_code(KC_Y); // "IH" yields "IF" (96x more common)
return_state = false; // done.
break;
*/
case KC_Y: // (y'all)
return_state = false; // done.
#ifdef FR_ADAPTIVES // eliminate 'h SFB for French
Expand All @@ -365,7 +386,7 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) {
break;

case KC_F:
switch (prior_keycode) {
switch (prior_keycode) { // IF is much more common than IY, so optimizing
case KC_Y: // YF = YI (eliminate SFB on ring finger)
tap_code(KC_I); // (YI is 37x more common)
return_state = false; // done.
Expand Down
21 changes: 10 additions & 11 deletions handsdown/vb-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
// We want to be able to define a combo by location
// for variation independent, spatial referencing, or
// by letter for mnemonic/phonetic referencing (variation dependent)
// put this sort of obscures the definitions…so…
// but this sort of obscures the definitions…so…
//
// BE CAREFUL to not double define a combo!
//
Expand All @@ -157,10 +157,10 @@
// the above combos may compete for the same locations,
// we'll define them all here.
//
#define HD_new_keys HD_LM2, HD_LB2 // new
#define HD_open_keys HD_LM1, HD_LB1 // open
#define HD_close_keys HD_LM3, HD_LB3 // close
#define HD_quit_keys HD_LB0, HD_LM0 // quit
#define HD_new_keys HD_LB0, HD_LM0 // new -- Since cmd/ctrl is on middle
#define HD_open_keys HD_RB0, HD_RM0 // open -- these must be 2 handed, so combo
#define HD_close_keys HD_RT0, HD_RM0 // close -- not strictly necessary?
#define HD_quit_keys HD_LT0, HD_LM0 // quit -- because q is on symbol layer
#define HD_find_keys HD_LM4, HD_LM0 // find selection
#define HD_sall_keys HD_LB4, HD_LB1 // select all
#define HD_swrd_keys HD_LB4, HD_LB0 // select word
Expand Down Expand Up @@ -218,12 +218,12 @@
#ifdef EN_PRONOUN_COMBOS_ALL // Admittedly of questionable value
#define HD_youd_keys HD_Y, HD_D // TYPE "you'd" + 've
#define HD_youll_keys HD_Y, HD_L // TYPE "you'll" + 've
#define HD_youre_keys HD_Y, HD_F // TYPE "you're"
#define HD_youre_keys HD_Y, HD_B // TYPE "you're"
#define HD_youve_keys HD_Y, HD_V // TYPE "you've"
#define HD_your_keys HD_Y, HD_R // TYPE "your"

#define HD_their_keys HD_T, HD_B // TYPE "their" #6 (R on same finger in Neu)
#define HD_theyre_keys HD_T, HD_X // "they're" (R on same finger in Neu)
#define HD_their_keys HD_T, HD_X // TYPE "their" #6 (R on same finger in Neu)
#define HD_theyre_keys HD_T, HD_B // "they're" (R on same finger in Neu)
#define HD_they_keys HD_T, HD_W // "they" #23 + 've (near they)
#define HD_theyll_keys HD_T, HD_M // "they'll" #23 + 've (M is easier to combo, also in We'll)
#define HD_theyd_keys HD_T, HD_P // "they'd" #23 + 've (no rationale for this, but no SFCombo)
Expand All @@ -232,7 +232,6 @@
#define HD_there_keys HD_T, HD_R // TYPE "there" #7 + 's
#define HD_here_keys HD_H, HD_R // TYPE "here" #5 + 's


#ifdef EN_W_PRONOUNS
#define HD_where_keys HD_X, HD_R // "where" + 's
#define HD_were_keys HD_X, HD_QUOT // TYPE "we're"
Expand Down Expand Up @@ -275,7 +274,7 @@
#define JP_pyu_keys HD_LB3, HD_RB1 // ぴゅ
#define JP_pyo_keys HD_LB3, HD_RB2 // ぴょ

#ifdef JP_YOUON_COMBOS_ALL // All Japanese contracted sounds
#ifdef JP_YOUON_COMBOS_ALL // All Japanese (in-use) contracted sounds

#define JP_gya_keys HD_LT1, HD_RM1 // ぎゃ
#define JP_gyu_keys HD_LT1, HD_RB1 // ぎゅ
Expand All @@ -299,7 +298,7 @@
//#define JP_hya_keys HD_RM4, HD_RM1 // ひゃ conflicts with diacritic
#define JP_hyu_keys HD_RM4, HD_RB1 // ひゅ
#define JP_hyo_keys HD_RM4, HD_RB2 // ひょ
//#define JP_fya_keys HD_RM4, HD_RM1 // ふぁ unnecessary?
//#define JP_fya_keys HD_RM4, HD_RM1 // ふぁ unnecessary? フェ!
//#define JP_fyu_keys HD_RM4, HD_RB1 // ふぃ
//#define JP_fye_keys HD_RM4, HD_RB1 // ふぇ
//#define JP_fyo_keys HD_RM4, HD_RB2 // ふぉ
Expand Down
2 changes: 1 addition & 1 deletion handsdown/vb-config.ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
// We want to be able to define a combo by location
// for variation independent, spatial referencing, or
// by letter for mnemonic/phonetic referencing (variation dependent)
// put this sort of obscures the definitions…so…
// but this sort of obscures the definitions…so…
//
// BE CAREFUL to not double define a combo!
//
Expand Down
6 changes: 4 additions & 2 deletions moutis.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ extern rgblight_config_t rgblight_config;
//#define THUMB_SHIFT // use the thumb shift variant instead of index shift


#define ADAPTIVE_ENABLE

#ifdef COMBO_HOLD
#undef ADAPTIVE_TERM
#define ADAPTIVE_TERM COMBO_HOLD * 1.35 // use COMBO_HOLD time as a standard threshold (same recation time)
Expand All @@ -75,8 +77,8 @@ extern rgblight_config_t rgblight_config;
#endif

#define ADAPT_VOWEL_H // eliminate vowel SFBs (AU/UA;EO/OE) using vH instead of v'
#define ADAPTIVE_ENABLE
#define ADAPTIVE_TRAILER KC_3
#define ADAPT_SHIFT KC_COMM // keycode to precede alpha for one-shot shift (leader)
#define ADAPTIVE_TRAILER KC_HASH
//#define FR_ADAPTIVES // eliminate 'h SFB for French

//#define THUMB_REPEATER
Expand Down
4 changes: 2 additions & 2 deletions moutis_ENCODER.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) {
// Left encoder Right encoder
// Unshifted Shifted Unshifted Shifted
// CCW, CW CCW, CW CCW, CW CCW, CW
{{{KC_VOLD,KC_VOLU}, {KC_BRID,KC_BRIU}}, {{KC_LEFT,KC_RIGHT}, {KC_UP, KC_DOWN}}}, // L_QWERTY, 0 - QWERTY compatibility layer
{{{KC_VOLD,KC_VOLU}, {KC_BRID,KC_BRIU}}, {{KC_LEFT,KC_RIGHT}, {KC_UP, KC_DOWN}}}, // L_HD, 1 - Hands Down Alpha layer
{{{KC_VOLD,KC_VOLU}, {KC_BRID,KC_BRIU}}, {{KC_LEFT,KC_RIGHT}, {KC_PGUP, KC_PGDN}}}, // L_QWERTY, 0 - QWERTY compatibility layer
{{{KC_VOLD,KC_VOLU}, {KC_BRID,KC_BRIU}}, {{KC_LEFT,KC_RIGHT}, {KC_PGUP, KC_PGDN}}}, // L_HD, 1 - Hands Down Alpha layer
{{{LS_LH5,LS_LH4}, {LS_LH4,LS_LH5}}, {{LS_RH4,LS_RH5}, {LS_RH4,LS_RH5}}}, // L_SYM, 2 - symbols, punctuation, off-map alphas
{{{LF_LH5,LF_LH4}, {LF_LH4,LF_LH5}}, {{LF_RH4,LF_RH5}, {LF_RH4,LF_RH5}}}, // L_FUN, 3 - function & number rows
{{{LN_LH5,LN_LH4}, {LN_LH4,LN_LH5}}, {{LN_RH4,LN_RH5}, {LN_RH4,LN_RH5}}}, // L_NUM, 4 - numpad (right); navpad (left)
Expand Down
4 changes: 3 additions & 1 deletion moutis_app_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

void process_APP_MENU(keyrecord_t *record) {
// KC_APP key gets special treatment
uint8_t saved_mods = get_mods(); // preserve mods

disable_caps_word(); // turn off CAPS_WORD
prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives.
if (record->event.pressed) {
Expand All @@ -32,7 +34,7 @@ void process_APP_MENU(keyrecord_t *record) {
}

if (saved_mods & MOD_MASK_SHIFT)
tap_code16(S(KC_TAB)); // switch app
tap_code16(RSFT(KC_TAB)); // switch app
else
tap_code(KC_TAB); // switch app
layer_on(L_NAV);
Expand Down
16 changes: 16 additions & 0 deletions moutis_combo.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ void process_combo_event(uint16_t combo_index, bool pressed) {
)
return;
#endif // JP_MODE_ENABLE

#ifdef ADAPT_SHIFT
// pseudo-adaptive comma-shift uses 2x ADAPTIVE_TERM, so pre-evaluated
if (
(prior_keycode == ADAPT_SHIFT) // is it shift leader?
// && ((timer_elapsed(prior_keydown) <= ADAPTIVE_TERM*2)) // within threshold?
// && ((combo_index >= HC_Q) && (combo_index <= HC_AE)) // followed by alpha combo?
// && ((combo_index >= HC_Th) && (combo_index <= HC_their_5gram)) // followed by alpha combo?
)
{
tap_code(KC_BSPC); // get rid of the ADAPT_SHIFT
register_code16(KC_LSFT); // This will unregister in matrix_scan_user_process_combo
prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives.
}
#endif

switch(combo_index) {
case PC_STAB ... COMBO_LENGTH:// these may have a hold delay BEFORE triggering
case HC_AT ... HC_COLN: //
Expand Down
16 changes: 10 additions & 6 deletions moutis_combo_def.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
//
// These definitions based on Hands Down Neu & variations'
// combo keycodes defined in the variation config
// ex "handsdonu-config.h"
//
// Combo definitions defined spatially
// Other variation dependent combos have predetermined
Expand Down Expand Up @@ -53,7 +52,6 @@ const uint16_t PROGMEM Hpste_combo[] = {HD_pste_keys, COMBO_END}; // paste (hold



/* examples of text entry combos */
const uint16_t PROGMEM H_Left_combo[] = {HD_LT3, HD_LT2, HD_LT1, COMBO_END}; // TYPE LeftComboTapE
const uint16_t PROGMEM H_Right_combo[] = {HD_RT1, HD_RT2, HD_RT3, COMBO_END}; // some demonstrator macro placeholder

Expand All @@ -62,8 +60,8 @@ const uint16_t PROGMEM F_SCLP_combo[] = {HD_LT2, HD_LT1, HD_LT0, COMBO_END}; //
const uint16_t PROGMEM F_SCAP_combo[] = {HD_LT3, HD_LT2, HD_LT1, HD_LT0, COMBO_END}; // SCREEN shot SELECTION to file


const uint16_t PROGMEM F_CAPS_combo[] = {HD_LM3, HD_LM2, HD_RM2, HD_RM3, COMBO_END}; // CAPS LOCK (on until hit again)
const uint16_t PROGMEM H_CAPW_combo[] = {HD_LM1, HD_LM2, HD_RM1, HD_RM2, COMBO_END}; // CAPS WORD (on until word delimiter)
const uint16_t PROGMEM H_CAPW_combo[] = {HD_RB3, HD_RB4, COMBO_END}; // CAPS WORD (on until word delimiter)
const uint16_t PROGMEM F_CAPS_combo[] = {HD_RB2, HD_RB3, HD_RB4, COMBO_END}; // CAPS LOCK (on until hit again)
const uint16_t PROGMEM H_EISUU_combo[] = {HD_LM3, HD_LM2, HD_LM1, COMBO_END}; // KC_MHEN
const uint16_t PROGMEM H_KANA_combo[] = {HD_RM3, HD_RM2, HD_RM1, COMBO_END}; // KC_HENK

Expand Down Expand Up @@ -99,15 +97,21 @@ const uint16_t PROGMEM Hat_combo[] = {HD_RT0, HD_RT1, COMBO_END}; // @
const uint16_t PROGMEM Hdier_combo[] = {HD_RB1, HD_RB2, COMBO_END}; // ¨ dieresis (dead key)
const uint16_t PROGMEM Henye_combo[] = {HD_LT4, HD_LT0, COMBO_END}; // ˜ enye (dead key) (ñ only?)
const uint16_t PROGMEM Hacut_combo[] = {HD_RM1, HD_RM2, COMBO_END}; // ´ acute (dead key)é

// for Neu/Au/Ti/Rh
const uint16_t PROGMEM Hgrv_combo[] = {HD_RM2, HD_RM3, COMBO_END}; // ` grave (dead key)
const uint16_t PROGMEM Hcirc_combo[] = {HD_RM1, HD_RM3, COMBO_END}; // ˆ circumflex (dead key)
const uint16_t PROGMEM Hmacr_combo[] = {HD_RM2, HD_RM4, COMBO_END}; // - macron (dead key)
const uint16_t PROGMEM Hring_combo[] = {HD_RM1, HD_RM4, COMBO_END}; // ˚ ring (dead key)
const uint16_t PROGMEM Hcedi_combo[] = {HD_LM4, HD_LM2, COMBO_END}; // ¸ cedille (dead key)
//const uint16_t PROGMEM Hoslsh_combo[] = {HD_RB2, HD_LB0, COMBO_END}; // ø/Ø or Wh

// Precomposed letters with diacritics (uses expanded Semantic Keys)
// This could be a very large numper of comboos, as many as 35 for vowels
// áàâåäā éèêe̊ëē íìîīï óòôo̊ōü úùûůūü
// two handed combos with home-row [p, r, m, i, l] + vowel
// and many more for frequently used consonants
// two handed combos top/bottom row vowel hand?


// TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ J & G respectively)byby=
const uint16_t PROGMEM H_Q_combo[] = {HD_Qu_keys, COMBO_END}; // TYPE "q" (Qu & Linger deletes u)
const uint16_t PROGMEM H_L1_combo[] = {HD_L1_keys, COMBO_END}; // ex. TYPE "z"
Expand Down
Loading

0 comments on commit 3110faf

Please sign in to comment.