From def65e6ad2ebc18e81667780ddd64adbcd6a7f4f Mon Sep 17 00:00:00 2001 From: moutis <35399827+moutis@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:15:32 -0500 Subject: [PATCH] Quarterly update from personal Includes a lot of code cleanup, conforming, collecting common settings/code, removal of unused experimental fragments. --- .gitignore | 3 + adapt_magic.c | 330 ++++++++++++++++++++++++++++++++++ config.h | 11 +- handsdown/adapt_h.c | 67 +++++++ handsdown/au-adaptive.c | 190 ++++---------------- handsdown/au-config.h | 10 +- handsdown/mi-adaptive.c | 132 +++----------- handsdown/nu-adaptive.c | 229 +++++++----------------- handsdown/pm-adaptive.c | 76 +++----- handsdown/vb-adaptive.c | 364 +++++++++++--------------------------- handsdown/vb-config.h | 16 +- handsdown/vb2-adaptive.c | 345 ++++++++++++++---------------------- handsdown/vb2-config.h | 22 +-- handsdown/vf-adaptive.c | 371 +++++++++++++++++---------------------- handsdown/vf-config.h | 18 +- handsdown/vv-adaptive.c | 364 ++++++++++++++------------------------ handsdown/vv-config.h | 6 +- handsdown/vx-adaptive.c | 332 +++++++++-------------------------- moutis.h | 59 ++++--- moutis_combo.c | 39 ++-- moutis_combo.h | 12 +- moutis_combo_def.c | 25 ++- moutis_layers.h | 37 ++-- moutis_process_record.c | 2 +- moutis_semantickeys.c | 3 +- moutis_semantickeys.h | 1 + personalizedmacros.h | 33 ---- rules.mk | 6 +- 28 files changed, 1274 insertions(+), 1829 deletions(-) create mode 100644 adapt_magic.c create mode 100644 handsdown/adapt_h.c delete mode 100755 personalizedmacros.h diff --git a/.gitignore b/.gitignore index 5a931f7..358ca5e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ JSON/.DS_Store .DS_Store .DS_Store personalizedmacros.h +personalizedmacros.h +personalizedmacros.h +personalizedmacros.h diff --git a/adapt_magic.c b/adapt_magic.c new file mode 100644 index 0000000..386bf6e --- /dev/null +++ b/adapt_magic.c @@ -0,0 +1,330 @@ +// +// adaptive_magic.c +// +// +// Created by Alan on 1/22/24. +// +// +// embedded in the switch in ive.c +// +// +// first the common non-alpha adaptives for macros (Basically a "Magic" key, like a reverse LeaderKey) +// + +case KC_SLSH: // the "MAGIC_SLSH" keys + if (preprior_keycode == KC_DOT) + break; + if (prior_keycode == KC_DOT) { // ./ but not ../ + send_string("com"); + return_state = false; // done. + } + break; +case KC_COMM: + switch (prior_keycode) { // a tap-dance of sorts + case KC_COMM: // double comma = CAPS_WORD. + tap_code(KC_BSPC); + toggle_caps_word(); + return_state = false; // done. + break; + } + break; +case KC_DOT: + if (preprior_keycode == KC_DOT) + break; + switch (prior_keycode) { + case KC_SLSH: // /. => ! + tap_code(KC_BSPC); + tap_code16(KC_EXLM); + return_state = false; // done. + break; + } + break; +case KC_DQUO: + switch (prior_keycode) { + case KC_DOT: + send_string("edu"); + return_state = false; // done. + break; + case KC_SLSH: // /" => ? + tap_code(KC_BSPC); + tap_code16(KC_QUES); + return_state = false; // done. + } + break; +case KC_QUOT: + switch (prior_keycode) { + case KC_DOT: + send_string("org"); + return_state = false; // done. + break; +#ifndef ADAPT_H // alternate way to handle the AU/EO SFBs + case KC_A: // + tap_code(KC_U); // "A'" yields "AU" + return_state = false; // done. + break; + case KC_U: + tap_code(KC_A); // "U'" yields "UA" + return_state = false; // done. + break; + case KC_E: + tap_code(KC_O); // "E'" yields "EO" + return_state = false; // done. + break; + case KC_O: + tap_code(KC_E); // "O'" yields "OE" + return_state = false; // done. + break; +#endif + } + break; + +#ifdef HD_MAGIC +case HD_MAGIC: // default is KC_HASH "#" + + if (preprior_keycode) // allow only 1 deep + break; + return_state = false; // presume we do something. + switch (prior_keycode) { + #ifdef A_MAGIC + case KC_A: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(A_MAGIC); // + break; + #endif + #ifdef B_MAGIC + case KC_B: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(B_MAGIC); // + break; + #endif + #ifdef C_MAGIC + case KC_C: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(C_MAGIC); // + break; + #endif + #ifdef D_MAGIC + case KC_D: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(D_MAGIC); // + break; + #endif + #ifdef E_MAGIC + case KC_E: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(E_MAGIC); // + break; + #endif + #ifdef F_MAGIC + case KC_F: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(F_MAGIC); // + break; + #endif + #ifdef G_MAGIC + case KC_G: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(G_MAGIC); // + break; + #endif + #ifdef H_MAGIC + case KC_H: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(H_MAGIC); // + break; + #endif + #ifdef I_MAGIC + case KC_I: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(I_MAGIC); // + break; + #endif + #ifdef J_MAGIC + case KC_J: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(J_MAGIC); // + break; + #endif + #ifdef K_MAGIC + case KC_K: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(K_MAGIC); // + break; + #endif + #ifdef L_MAGIC + case KC_L: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(L_MAGIC); // + break; + #endif + #ifdef M_MAGIC + case KC_M: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(M_MAGIC); // + break; + #endif + #ifdef N_MAGIC + case KC_N: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(N_MAGIC); // + break; + #endif + #ifdef O_MAGIC + case KC_O: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(O_MAGIC); // + break; + #endif + #ifdef P_MAGIC + case KC_P: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(P_MAGIC); // + break; + #endif + #ifdef R_MAGIC + case KC_R: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(R_MAGIC); // + break; + #endif + #ifdef S_MAGIC + case KC_S: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(S_MAGIC); // + break; + #endif + #ifdef T_MAGIC + case KC_T: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(T_MAGIC); // + break; + #endif + #ifdef U_MAGIC + case KC_U: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(U_MAGIC); // + break; + #endif + #ifdef V_MAGIC + case KC_V: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(V_MAGIC); // + break; + #endif + #ifdef W_MAGIC + case KC_W: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(W_MAGIC); // + break; + #endif + #ifdef X_MAGIC + case KC_X: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(X_MAGIC); // + break; + #endif + #ifdef Y_MAGIC + case KC_Y: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(Y_MAGIC); // + break; + #endif + #ifdef Z_MAGIC + case KC_Z: // + tap_code(KC_BSPC); // and may have been lowercase + send_string(Z_MAGIC); // + break; + #endif + default: // + return_state = true; // didn't end up doing anything. + } + break; +#endif // HD_MAGIC + +#ifdef HD_MAGIC_A + case HD_MAGIC_A: // + switch (prior_keycode) { + case KC_E: // + tap_code(KC_O); // + return_state = false; // done. + break; + case KC_O: // + tap_code(KC_E); // + return_state = false; // done. + break; + case KC_A: // + tap_code(KC_U); + return_state = false; // done. + break; + case KC_U: // + tap_code(KC_A); // + return_state = false; // done. + break; + } + break; +#endif // HD_MAGIC_A + +#ifdef HD_MAGIC_B + case HD_MAGIC_B: // for most common double letters (inherently SFBs) + switch (prior_keycode) { + case KC_L: // LN eliminate SFB + case KC_M: // MN eliminate SFB + tap_code(KC_N); + return_state = false; // done. + break; +#ifndef HD_MAGIC_A + case KC_E: // + tap_code(KC_O); // + return_state = false; // done. + break; + case KC_O: // + tap_code(KC_E); // + return_state = false; // done. + break; + case KC_A: // + tap_code(KC_U); + return_state = false; // done. + break; + case KC_U: // + if (preprior_keycode == KC_O) // oux (french) + tap_code(KC_X); // + else + tap_code(KC_A); // + return_state = false; // done. + break; +#endif +/* double-letter frequencies from Peter Norvig's data + * nearly all double consonants are followed by a vowel, and double vowels by a consonant + * which limits candidates to basically consonant thumb to avoid possible scissoring/SFBs. + * Each case needs to be vetted. + */ +/* + case KC_L: // (0.577%) // Hands Down Platinum – not exactly recommended + case KC_S: // (0.405%) + case KC_E: // (0.378%) // with cons on thumb, these are problematic + case KC_O: // (0.210%) + case KC_T: // (0.171%) // Hands Down Gold + case KC_F: // (0.146%) + case KC_P: // (0.137%) + case KC_R: // (0.121%) // Hands Down Titanium/Rhodium/Vibranium/Promethium +// These aren't frequent enough to bother? + case KC_M: // (0.096%) + case KC_C: // (0.083%) + case KC_N: // (0.073%) // Hands Down Silver + case KC_D: // (0.043%) + case KC_G: // (0.025%) +// These are def not frequent enough to bother? + case KC_I: // (0.023%) + case KC_B: // (0.011%) + case KC_A: // (0.003%) + case KC_Z: // (0.003%) + case KC_X: // (0.003%) + case KC_U: // (0.001%) + case KC_H: // (0.001%) // Hands Down Bronze +*/ + default: // make it a dumb repeater + tap_code(prior_keycode); // eliminate SFB on double + return_state = false; // done. + } + break; +#endif // HD_MAGIC_B diff --git a/config.h b/config.h index 4363ca0..60df454 100644 --- a/config.h +++ b/config.h @@ -26,19 +26,22 @@ #undef LOCKING_RESYNC_ENABLE #define TAPPING_TOGGLE 2 - #ifdef TAPPING_TERM #undef TAPPING_TERM #define TAPPING_TERM 170 // Mod TAP VS HOLD timing in milliseconds #endif // Pick good defaults for enabling homerow modifiers -#define TAP_CODE_DELAY 10 -#define TAP_HOLD_CAPS_DELAY 10 +//#define HOLD_ON_OTHER_KEY_PRESS #define PERMISSIVE_HOLD - //#define IGNORE_MOD_TAP_INTERRUPT +#ifdef TAP_CODE_DELAY +#undef TAP_CODE_DELAY +#endif +#define TAP_CODE_DELAY 20 // time between register/unregister (some keycodes go missing/out of sequence) +#define TAP_HOLD_CAPS_DELAY 180 // for Mac + #ifdef COMBO_ENABLE #ifdef COMBO_COUNT #undef COMBO_COUNT diff --git a/handsdown/adapt_h.c b/handsdown/adapt_h.c new file mode 100644 index 0000000..80afa1f --- /dev/null +++ b/handsdown/adapt_h.c @@ -0,0 +1,67 @@ +/* + * adapt_h.c + * the common vowel block adaptives (esp. for "AU" SFB) + * + * included at the end of process_adaptive_key + */ + + +#ifdef ADAPT_H +/* + * H is a "Magic" adaptive key, depending on the preceding alphas + */ + case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) so adaptive H is a sort of Magic Key + switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? +#if !defined(ADAPT_AE_AU) && !defined(DE_ADAPTIVES) // AU is really common it German (and influences EN/FR) + case KC_A: // AE is a fraction less common (8x), but the EAE trill may be harder than EAH. + tap_code(KC_U); // "AH" yields "AU" (7x more common) + return_state = false; // done. + break; +#endif // ADAPT_AE_AU or !DE_ADAPTIVES + case KC_U: // + tap_code(KC_A); // "UH" yields "UA" (126x more common) + return_state = false; // done. + break; + case KC_E: // these EO/OE adaptives are of questionable value + tap_code(KC_O); // "EH" yields "EO" (1.75:1) + return_state = false; // done. + break; + case KC_O: + tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) + return_state = false; // done. + break; +#ifndef FR_ADAPTIVES +// these are possible, but rather uncommon + case KC_L: // LH->LN (4.43 202207313) + case KC_M: // MH->MN (15.49 232816441) + tap_code(KC_N); // + return_state = false; // done. + break; + case KC_N: // NH->NL (4.86 1491607169) + tap_code(KC_L); + return_state = false; // done. + break; +#else // FR_ADAPTIVES // eliminate 'h SFB for French + case KC_J: // ex. j'habite + case KC_L: // ex. l'hôtel + case KC_N: // ex. n'habite + case KC_D: // ex. d'habitude +#ifdef EN_HDIGRAPH_COMBOS + case KC_T: // t'habitude can't do this (bc Th) unless Th digraph combo is used… +#endif // EN_HDIGRAPH_COMBOS + tap_code(KC_QUOT); // YH => Y' (pull down to reduce ring-pinky T-B scissor) + break; +#endif // FR_ADAPTIVES + } + break; +#endif // ADAPT_H + +#if defined(ADAPT_AE_AU) || defined(DE_ADAPTIVES) // AU is really common in German (and influences EN/FR) + case KC_E: + switch (prior_keycode) { + case KC_A: // "AE" yields "AU" (8x more common) keeping it on home row + tap_code(KC_U); + return_state = false; // done. + } + break; +#endif // ADAPT_AE_AU diff --git a/handsdown/au-adaptive.c b/handsdown/au-adaptive.c index a30a014..61f0d90 100755 --- a/handsdown/au-adaptive.c +++ b/handsdown/au-adaptive.c @@ -1,30 +1,28 @@ /* Adaptive Keys - Called from within process_record_user - + Called from early within process_record_user + Tailored for HD Gold (au) NOTE: assumed dual-function keys (MOD_TAP, LAYER_TAP) have already been handled AND FILTERED OUT! The combos handler will have already taken out combo candidates, which have a shorter keydown threshhold (COMBO_TERM). - All the goto shenanigans should be resolved after complete migration to STM/RP controllersr - (not totally possible, as many of my boards have embedded AVR mcus) - */ -// Hands Down Gold -// ╭─────────────────────╮ ╭─────────────────────╮ -// │ J G M P V │ │ #$ .: /* "[ '] │ -// │ R S N D B | | ,; A E I H │ -// │ X F L C W │ │ -+ U O Y K │ -// ╰───────────╮ BSP T │ │ SPC RET ╭──────────╯ -// ╰─────────╯ ╰──────────╯ -// Q (LT3) & Z (LT4) are on the punc layer +// Base (alpha) Layer Hands Down Gold (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ J G M P V │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// tab │ R S N D B | ( ) | ,; A E I H │ LANG1/mhen +// Z │ X F L C W │ [ copy pste ] │ -+ U O Y K │ Q +// ╰───────────╮ bsp T │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn + +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { bool return_state = true; // assume we don't do anything. - + // Are we in an adaptive context? (adaptive on is assumed). if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM) { // outside adaptive threshhold prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives. @@ -38,38 +36,25 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { unregister_mods(MOD_MASK_SHIFT); //CAPS_WORD/LOCK won't be affected. } // may want more granular control than this… - switch (keycode & QK_BASIC_MAX) { // process ignoring multi-function keys +// switch (((keycode >= SAFE_RANGE) && (keycode <= SemKeys_COUNT)) ? (keycode) : (keycode & QK_BASIC_MAX)) { // only handling normal, SHFT or ALT cases. + + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ - case KC_M: // M becomes L (pull up "L" to same row) - switch (prior_keycode) { - case KC_P: // pull up "L" (PL is 15x more common than PM) - case KC_G: // pull up "L" (GL is 5x more common than GM) - tap_code(KC_L); // pull up "L" - return_state = false; // done. - break; - case KC_J: // - tap_code(KC_BSPC); - tap_code(KC_L); - break; - } - break; - case KC_B: // avoid the index-middle split switch (prior_keycode) { case KC_P: // pull up M over + tap_code(KC_BSPC); tap_code(KC_M); - return_state = false; // done. + break; case KC_D: // pull L over tap_code(KC_L); // pull up "L" return_state = false; // done. break; - break; - } + } break; - case KC_D: // switch (prior_keycode) { // case KC_B: @@ -79,6 +64,19 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } break; + case KC_M: // M becomes L (pull up "L" to same row) + switch (prior_keycode) { + case KC_P: // pull up "L" (PL is 15x more common than PM) + case KC_G: // pull up "L" (GL is 5x more common than GM) + tap_code(KC_L); // pull up "L" + return_state = false; // done. + break; + case KC_J: // + tap_code(KC_BSPC); + tap_code(KC_L); + break; + } + break; case KC_P: switch (prior_keycode) { case KC_G: // avoid the LP scissor @@ -96,7 +94,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - case KC_X: // switch (prior_keycode) { // case KC_C: // CD is 70x more common than CX @@ -111,83 +108,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { /* // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // How often are we likely to hit BS so quickly after? - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_A: // AE is a fraction less common, but I find the EAE trill harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (8x more common) - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) - return_state = false; // done. - break; - - } - break; - case KC_K: switch (prior_keycode) { case KC_Y: // eliminate SFB on ring finger @@ -196,52 +116,12 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_U: - switch (prior_keycode) { - case KC_K: // make KU send Qu - tap_code(KC_BSPC); - tap_code(KC_Q); - break; - } - break; +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/au-config.h b/handsdown/au-config.h index 79cfc1d..ccf58f8 100755 --- a/handsdown/au-config.h +++ b/handsdown/au-config.h @@ -66,7 +66,7 @@ // Z │ X F L C W │ [ copy pste ] │ -+ U O Y K │ Q // ╰───────────╮ bsp T │ & | │ spc ret ╭──────────╯ // left rght app ╰─────────╯ ╰──────────╯ tgLN up dn -// + // For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer // and accessible combos (defined below) // @@ -172,8 +172,8 @@ #define HD_tab_keys HD_LT4, HD_LT3 // tab #define HD_stab_keys HD_LT4, HD_LT3, HD_LT2 // Shift-tab #define HD_spc_keys HD_LM1, HD_LM0 // SPACE -#define HD_ent_keys HD_LB0, HD_LB1 // ENTER -#define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break +#define HD_ent_keys HD_LM4, HD_LM3 // ENTER +#define HD_ent2_keys HD_LB4, HD_LB3, HD_LB2 // hard-ENTER/page break #define APPMENU_keys HD_LT1, HD_LT0 // APPMENU #define APPMENU_nav_keys LN_LT1, LN_LT0 // APPMENU @@ -193,11 +193,11 @@ // #define HD_Th_keys HD_LM2, HD_LM1 // TYPE "th" #define HD_Ch_keys HD_LM3, HD_LM1 // TYPE "ch" -#define HD_Wh_keys HD_LT4, HD_LT3 // TYPE "wh" +#define HD_Wh_keys HD_LB0, HD_LB1 // TYPE "wh" #define HD_Sh_keys HD_LM3, HD_LM2 // TYPE "sh" #define HD_Ph_keys HD_LT1, HD_LT2 // TYPE "ph" #define HD_Gh_keys HD_LT3, HD_LT2 // TYPE "gh" -#define HD_Sch_keys HD_LM4, HD_LM3, HD_LM2 // TYPE "Sch" +#define HD_Sch_keys HD_LM4, HD_LM3, HD_LM1 // TYPE "Sch" // Should we put all the diacritic keys here? // or get keep them all in the common area (if they all share diff --git a/handsdown/mi-adaptive.c b/handsdown/mi-adaptive.c index 42b6eec..b89ea6a 100644 --- a/handsdown/mi-adaptive.c +++ b/handsdown/mi-adaptive.c @@ -1,26 +1,31 @@ /* Adaptive Keys - Called from within process_record_user - + Called from early within process_record_user + Tailored for HD Mithril (mi) NOTE: assumed dual-function keys (MOD_TAP, LAYER_TAP) have already been handled AND FILTERED OUT! The combos handler will have already taken out combo candidates, which have a shorter keydown threshhold (COMBO_TERM). - All the goto shenanigans should be resolved after complete migration to STM/RP controllersr - (not totally possible, as many of my boards have embedded AVR mcus) - */ +// Base (alpha) Layer Hands Down Mithril (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ W P G D Z │ L_CFG L_NUM │ #$ .: /* '[ J │ LANG2/henk +// tab │ C N S T K | ( ) | ,; I E A H │ LANG1/mhen +// Z │ Y B F M V │ [ copy pste ] │ -+ U O "] L │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer -bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) { +bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { bool return_state = true; // assume we don't do anything. - uint16_t keycode = *calling_keycode; // Are we in an adaptive context? (adaptive on is assumed). if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM) { // outside adaptive threshhold - prior_keycode = prior_keydown = 0; // turn off Adaptives. + prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives. return true; // no adaptive conditions, so return. } @@ -31,7 +36,9 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) unregister_mods(MOD_MASK_SHIFT); //CAPS_WORD/LOCK won't be affected. } // may want more granular control than this… - switch (keycode & QK_BASIC_MAX) { // process ignoring multi-function keys +// switch (((keycode >= SAFE_RANGE) && (keycode <= SemKeys_COUNT)) ? (keycode) : (keycode & QK_BASIC_MAX)) { // only handling normal, SHFT or ALT cases. + + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) @@ -42,111 +49,12 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // How often are we likely to hit BS so quickly after? - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; - } - break; - +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/nu-adaptive.c b/handsdown/nu-adaptive.c index e6eb8db..bd1d144 100755 --- a/handsdown/nu-adaptive.c +++ b/handsdown/nu-adaptive.c @@ -1,27 +1,28 @@ /* Adaptive Keys - Called from within process_record_user - + Called from early within process_record_user + Tailored for HD Neu (neu) NOTE: assumed dual-function keys (MOD_TAP, LAYER_TAP) have already been handled AND FILTERED OUT! The combos handler will have already taken out combo candidates, which have a shorter keydown threshhold (COMBO_TERM). - */ -// Hands Down Neu -// ╭─────────────────────╮ ╭─────────────────────╮ -// │ W F M P V │ │ #$ .: /* "[ '] │ -// │ R S N T B | | ,; A E I H │ -// │ X C L D G │ │ -+ U O Y K │ -// ╰───────────╮ BSP SPC │ │ SPC RET ╭──────────╯ -// ╰─────────╯ ╰──────────╯ -// Q (LT3) & Z (LT4) are on the punc layer +// Base (alpha) Layer Hands Down Neu (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ W F M P V │ L_CFG L_NUM │ #$ .: '" /* J │ LANG2/henk +// tab │ R S N T B | ( ) | ,; A E I H │ LANG1/mhen +// Z │ X C L D G │ [ copy pste ] │ -+ U O Y K │ Q +// ╰───────────╮ bsp sft │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer + bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { bool return_state = true; // assume we don't do anything. - + // Are we in an adaptive context? (adaptive on is assumed). if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM) { // outside adaptive threshhold prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives. @@ -35,11 +36,53 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { unregister_mods(MOD_MASK_SHIFT); //CAPS_WORD/LOCK won't be affected. } // may want more granular control than this… - switch (keycode & QK_BASIC_MAX) { // process ignoring multi-function keys +// switch (((keycode >= SAFE_RANGE) && (keycode <= SemKeys_COUNT)) ? (keycode) : (keycode & QK_BASIC_MAX)) { // only handling normal, SHFT or ALT cases. + + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ + case KC_B: // avoid the index-middle split + switch (prior_keycode) { + case KC_P: // pull up M over + tap_code(KC_M); + return_state = false; // done. + case KC_D: // pull L over + tap_code(KC_L); + return_state = false; // done. + break; + break; + } + break; + case KC_D: // + switch (prior_keycode) { // + case KC_G: + tap_code(KC_L); + return_state = false; // done. + break; + } + break; + case KC_G: // avoid the index-middle split + switch (prior_keycode) { + case KC_T: // pull N over + tap_code(KC_N); + return_state = false; // done. + case KC_D: // pull L over + tap_code(KC_BSPC); + tap_code(KC_L); + return_state = false; // done. + break; + } + break; + case KC_V: + switch (prior_keycode) { // + case KC_M: // Eliminate ML SFB + tap_code(KC_L); // MV = ML (14.89 121716301) + return_state = false; // done. + break; + } + break; case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { case KC_P: // pull up "L" (PL is 15x more common than PM) @@ -62,29 +105,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { }; } break; - - case KC_B: // avoid the index-middle split - switch (prior_keycode) { - case KC_P: // pull up M over - tap_code(KC_M); - return_state = false; // done. - case KC_D: // pull L over - tap_code(KC_L); - return_state = false; // done. - break; - break; - } - break; - - break; - case KC_D: // - switch (prior_keycode) { // - case KC_G: - tap_code(KC_L); - return_state = false; // done. - break; - } - break; case KC_P: switch (prior_keycode) { case KC_F: // avoid the scissor @@ -103,19 +123,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - case KC_G: // avoid the index-middle split - switch (prior_keycode) { - case KC_T: // pull N over - tap_code(KC_N); - return_state = false; // done. - case KC_D: // pull L over - tap_code(KC_BSPC); - tap_code(KC_L); - return_state = false; // done. - break; - } - break; - case KC_T: // alt fingering remedy for middle-index splits switch (prior_keycode) { case KC_B: // @@ -134,83 +141,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // How often are we likely to hit BS so quickly after? - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_A: // AE is a fraction less common, but I find the EAE trill harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (8x more common) - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) - return_state = false; // done. - break; - - } - break; - case KC_K: switch (prior_keycode) { case KC_Y: // eliminate SFB on ring finger @@ -219,51 +149,12 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - case KC_U: - switch (prior_keycode) { - case KC_K: // make KU send Qu - tap_code(KC_BSPC); - tap_code(KC_Q); - break; - } - break; +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/pm-adaptive.c b/handsdown/pm-adaptive.c index c5a41b6..3fef0fa 100755 --- a/handsdown/pm-adaptive.c +++ b/handsdown/pm-adaptive.c @@ -9,6 +9,20 @@ which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Promethium (HRMs /+ thumb mods) +// this is canonical Promethium, "inverted" (top-bottom), as +// I prefer "bottom heavy" layouts. If you prefer top heavy, +// be sure to invert all rows, as the rolling/scissoring characteristics +// that make Promethium what it is depend on the same-row neighbors +// ※ arguably, the inner column is less sensitive to this. +// ╭─────────────────────╮ ╭─────────────────────╮ +// LANG1/mhen │ V W G M J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// esc │ S N T H K | ( ) | ,; A E I C │ Z +// tab │ F P D L X │ [ copy pste ] │ -+ U O Y B │ Q(u) +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { @@ -30,6 +44,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) { // process ignoring multi-function keys & shift state? + /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ @@ -84,7 +99,7 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; case KC_J: switch (prior_keycode) { - case KC_G: // "GTH" is an awkward trigram/skipgram + case KC_G: // 99.7% of GT are followed by H send_string("th"); // for "length" return_state = false; // done. break; @@ -186,13 +201,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { // right hand adaptives */ - case KC_E: - switch (prior_keycode) { - case KC_A: // "AE" yields "AU" (8x more common) - tap_code(KC_U); - return_state = false; // done. - } - break; case KC_B: switch (prior_keycode) { case KC_Y: // avoid ring->pinky scissor @@ -201,56 +209,20 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; // process the B normally } break; +// PM doesn't use the common vowel block, so… +//#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - break; - case KC_SLSH: // /" => ? - tap_code(KC_BSPC); - tap_code16(KC_QUES); - return_state = false; // done. - } - break; - case KC_COMM: - switch (prior_keycode) { - case KC_COMM: // double comma = CAPS_WORD. - tap_code(KC_BSPC); - toggle_caps_word(); - return_state = false; // done. - break; - } - break; - case KC_DOT: + case KC_E: switch (prior_keycode) { - case KC_SLSH: // /. => ! - tap_code(KC_BSPC); - tap_code16(KC_EXLM); + case KC_A: // "AE" yields "AU" (8x more common) keeping it on home row + tap_code(KC_U); return_state = false; // done. - break; } break; -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/vb-adaptive.c b/handsdown/vb-adaptive.c index b0b0149..a14d03e 100755 --- a/handsdown/vb-adaptive.c +++ b/handsdown/vb-adaptive.c @@ -9,6 +9,15 @@ which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Vibranium-vb (HRMs) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ X W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen +// Z │ B P L D V │ [ copy pste ] │ -+ U O Y F │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { @@ -30,20 +39,17 @@ 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) { // process ignoring multi-function keys & shift state? + /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ case KC_B: switch (prior_keycode) { - case KC_D: // avoid SFB (DV is 5x more common than DB) - tap_code(KC_V); - return_state = false; // done. - break; - case KC_P: // avoid row step (PS is 40x more common than PB) + case KC_P: // avoid row step (PS is 40x more common than PB) tap_code(KC_S); return_state = false; // done. break; - case KC_C: // eliminate SB SFB (CB is 11x more common than SB) + case KC_C: // eliminate SB SFB (SB is 11x more common than CB) tap_code(KC_BSPC); tap_code(KC_S); break; @@ -63,7 +69,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; case KC_D: // (for KD=KL; least code, no side effects) switch (prior_keycode) { // - case KC_K: case KC_V: tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. @@ -78,28 +83,73 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; case KC_G: switch (prior_keycode) { - case KC_K: + case KC_J: // roll JG => jpg free letter! + tap_code(KC_P); // insert a P + break; // and let current keycode send normally + case KC_K: // eliminate index-middle stretch with alt fingering tap_code(KC_L); // pull up "L" (KL is 5x more common than KG) return_state = false; // done. break; - case KC_M: - if (preprior_keycode == KC_W) { // to roll WMG -> lml? - tap_code(KC_L); // replace the G with L + case KC_M: // eliminate scissor + if (preprior_keycode == KC_W) { // to roll WMG -> lml? (no side effects?) + tap_code(KC_L); // G kecomes L for "LML" return_state = false; // done. - break; + break; // and process current keycode normally } tap_code(KC_BSPC); // replace M tap_code(KC_L); // "pull up" L to eliminate scissor - break; // and let current keycode send normally - case KC_J: // JG = jpg - tap_code(KC_P); // insert a P - break; // and let current keycode send normally + break; // and process current keycode normally case KC_W: tap_code(KC_D); // pull up D (WD is 35x more common than WG) return_state = false; // done. break; } break; + case KC_J: + switch (prior_keycode) { // + case KC_G: // 99.7% of GT are followed by H + send_string("th"); // as in "length" + return_state = false; // done. + break; + case KC_M: // Eliminate MN SFB + tap_code(KC_L); // MJ = ML (43.43 126965511) + return_state = false; // done. + break; + case KC_V: // Eliminate VL Scissor + case KC_W: // Eliminate WL scissor + tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) + return_state = false; // done. + break; + } + break; + // 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_D: // eliminate index-middle stretch with alt fingering + case KC_G: + tap_code(KC_BSPC); // replace D/G + tap_code(KC_L); // D/GK = LK (LK ismore common than D/GK) + break; // Send K normally + case KC_T: // eliminate lateral stretch + tap_code(KC_BSPC); // replace T + tap_code(KC_C); // HK = CK + break; // Send K normally + } + break; + case KC_L: // catch this so we can unshift L on these rolls. + switch (prior_keycode) { + case KC_B: + case KC_C: + case KC_P: + case KC_S: + case KC_V: + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + return_state = false; // done. + break; + } + break; case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { case KC_G: // pull up "L" (GL is 5x more common than GM) @@ -110,7 +160,8 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; case KC_W: // WM = LM (LM 20x more common) switch (preprior_keycode) { - case KC_M: + case KC_M: // for lml + case KC_X: // for xpl tap_code(KC_L); return_state = false; // done. break; @@ -119,33 +170,10 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { send_string("lm"); return_state = false; // done. break; - } - } - break; - case KC_W: // W becomes P (pull up "P" to same row) - switch (prior_keycode) { - case KC_M: // pull up P (W becomes P after M to set up "mp"+l) - if (preprior_keycode == KC_W) { // except for WMW -> lml? - tap_code(KC_L); // replace the W with L - return_state = false; // done. - break; - } // drop through! - case KC_W: // WW doesn't exist, so to permit PP after M... - case KC_X: // pull up P (W becomes P after X to set up "xp"+l) - tap_code(KC_P); // pull up P from bottom row. - return_state = false; // done. - break; - case KC_G: - 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; - // If not using H-digraph combos, consider this adaptive solution? #ifndef EN_HDIGRAPH_COMBOS case KC_N: // N becomes H (for H-Digraph rolls) @@ -167,7 +195,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { send_string("ion"); return_state = false; // done. break; -// case KC_C: // cn = ln (CN 5x more common) case KC_X: // xn = ln (LN 101x more common) tap_code(KC_BSPC); tap_code(KC_L); @@ -176,7 +203,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } break; #endif - case KC_P: switch (prior_keycode) { case KC_D: // DP = DT eliminate SFB (DT is 2.5x more common) @@ -186,8 +212,7 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { case KC_B: // Pull S down (SP is 83x more common than BP) tap_code(KC_BSPC); tap_code(KC_S); //(but maybe should be BS? SP/BS are about equal...) - return_state = true; // not done (process this key normally) - break; + break; // allow B to } break; case KC_T: // alt fingering remedy for middle-index splits @@ -198,87 +223,54 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - // 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; // Send K normally - case KC_D: - case KC_G: - tap_code(KC_BSPC); // replace D/G - tap_code(KC_L); - break; // Send K normally - } - break; case KC_V: // remedy inner column split by shifting fingering - switch (prior_keycode) { -// case KC_D: // TV/DV/GV = LV () -// case KC_G: // - - case KC_T: // TK/DK/GK = LK () + switch (prior_keycode) { // because the hand is already + case KC_D: // dislodged from the home block. + case KC_T: // TV/DV = LV () tap_code(KC_BSPC); tap_code(KC_L); break; // and let current keycode send normally } break; - -/* - case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB - switch (prior_keycode) { - case KC_L: // quickly typing "lr" yields "ll" (+56x) - tap_code(KC_L); - return_state = false; // done. - break; - } - break; -*/ - case KC_X: + case KC_W: // W becomes P (pull up "P" to same row) switch (prior_keycode) { - case KC_M: // "MB" is 2558x more frequent than "MX" - tap_code(KC_B); // pull up B from bottom row. + case KC_G: + tap_code(KC_D); // eliminate SFB on index return_state = false; // done. break; - case KC_G: // "GX" is 778x more frequent than "GT" - tap_code(KC_T); // eliminate GT SFB. + case KC_M: // pull up P (W becomes P after M to set up "mp"+l) + if (preprior_keycode == KC_W) { // except for WMW -> lml? + tap_code(KC_L); // replace the W with L + return_state = false; // done. + break; + } // drop through! + case KC_W: // WW doesn't exist, so to permit PP after M... + case KC_X: // pull up P (W becomes P after X to set up "xp"+l) + tap_code(KC_P); // pull up P from bottom row. return_state = false; // done. break; - case KC_N: // avoid SFB (NL is 23x more common than NX) + case KC_N: // avoid SFB (NL is 10x more common than NW) tap_code(KC_L); return_state = false; // done. break; } break; - - - case KC_J: + case KC_X: switch (prior_keycode) { - case KC_G: // "GTH" is an awkward trigram/skipgram - send_string("th"); // for "length" + case KC_D: // eliminate DV SFB. + tap_code(KC_V); // "DV" is 413x more frequent than "DX" return_state = false; // done. break; - case KC_M: // Eliminate MN SFB - tap_code(KC_N); // MJ = mn (MN is 83x more common than MJ) + case KC_G: // eliminate GT SFB. + tap_code(KC_T); // "GT" is 778x more frequent than "GX" return_state = false; // done. break; - case KC_W: // Eliminate WL scissor - tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) + case KC_M: // eliminate MB scissor. + tap_code(KC_B); // "MB" is 2558x more frequent than "MX" return_state = false; // done. break; - } - break; - - case KC_L: // catch this so we can unshift L on these rolls. - switch (prior_keycode) { - case KC_P: - case KC_B: // - case KC_S: // - case KC_V: // - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + case KC_W: // eliminate WS scissor. + tap_code(KC_S); // return_state = false; // done. break; } @@ -288,124 +280,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - break; - - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? -#ifdef ADAPT_VOWEL_H -#ifndef DE_ADAPTIVES // AU is really common it German (and influences EN/FR) - case KC_A: // AE is a fraction less common (8x), but the EAE trill may be harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (7x more common) - return_state = false; // done. - break; -#endif // DE_ADAPTIVES - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) - return_state = false; // done. - break; - case KC_E: // these EO/OE adaptives are of questionable value - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; -#endif // ADAPT_VOWEL_H - 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_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 - case KC_J: // ex. j'habite - case KC_L: // ex. l'hôtel - case KC_N: // ex. n'habite - case KC_D: // ex. d'habitude -#ifdef EN_HDIGRAPH_COMBOS - case KC_T: // t'habitude can't do this (bc Th) unless Th digraph combo is used… -#endif // EN_HDIGRAPH_COMBOS -#endif // FR_ADAPTIVES - tap_code(KC_QUOT); // YH => Y' (pull down to reduce ring-pinky T-B scissor) - break; - case KC_L: // quickly typing "lh" yields "ll" (355x) - tap_code(KC_L); - return_state = false; // done. - break; - } - break; -#ifdef DE_ADAPTIVES // AU is really common it German (and influences EN/FR) - case KC_I: - switch (prior_keycode) { - case KC_A: // "AI" yields "AU" (8x more common) - tap_code(KC_U); - return_state = false; // done. - break; - } - break; -#endif // DE_ADAPTIVES case KC_F: switch (prior_keycode) { // IF is much more common than IY, so optimizing case KC_Y: // YF = YI (eliminate SFB on ring finger) @@ -414,52 +288,12 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - case KC_COMM: - switch (prior_keycode) { - case KC_COMM: // double comma = CAPS_WORD. - tap_code(KC_BSPC); - toggle_caps_word(); - return_state = false; // done. - break; - } - break; +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // should any alpha be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% // Hands Down Platinum – not exactly recommended - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% // Hands Down Gold - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% // Hands Down Titanium/Rhodium/Vibranium - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% // Hands Down Silver - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% // Hands Down Bronze -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif // THUMB_REPEATER -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/vb-config.h b/handsdown/vb-config.h index 20237b3..6b6516c 100755 --- a/handsdown/vb-config.h +++ b/handsdown/vb-config.h @@ -59,7 +59,7 @@ // LH5 LH4 LH3 ╰─────────╯ ╰─────────╯ RH3 RH4 RH5 // // -// Base (alpha) Layer Hands Down Vibranium-vb (HRMs /+ thumb mods) +// Base (alpha) Layer Hands Down Vibranium-vb (HRMs) // ╭─────────────────────╮ ╭─────────────────────╮ // esc │ X W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk // tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen @@ -169,12 +169,12 @@ #define HD_copy_keys HD_LB3, HD_LB2 // copy (hold for cut) #define HD_pste_keys HD_LB2, HD_LB1 // paste (hold for paste-match) -#define HD_tab_keys HD_LT4, HD_LT3 // tab -#define HD_stab_keys HD_LT4, HD_LT3, HD_LT2 // Shift-tab -#define HD_spc_keys HD_LM1, HD_LM0 // SPACE -#define HD_ent_keys HD_LB0, HD_LB1 // ENTER -#define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break -#define APPMENU_keys HD_LT1, HD_LT0 // APPMENU on alpha layer +#define HD_tab_keys HD_LT4, HD_LT3 // tab +#define HD_stab_keys HD_LT4, HD_LT3, HD_LT2 // Shift-tab +#define HD_spc_keys HD_LM1, HD_LM0 // SPACE +#define HD_ent_keys HD_LB0, HD_LB1 // ENTER +#define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break +#define APPMENU_keys HD_LT1, HD_LT0 // APPMENU on alpha layer #define APPMENU_nav_keys LV_LT1, LV_LT0 // APPMENU on Nav layer // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) @@ -304,7 +304,7 @@ //#define JP_fyo_keys HD_RM4, HD_RB2 // ふぉ #define JP_bya_keys HD_LB4, HD_RM1 // びゃ -#define JP_byu_keys HD_LB4, HD_RB1 // びゅ conflicts with diacritic? +#define JP_byu_keys HD_LB4, HD_RB1 // びゅ #define JP_byo_keys HD_LB4, HD_RB2 // びょ #define JP_mya_keys HD_LT2, HD_RM1 // みゃ #define JP_myu_keys HD_LT2, HD_RB1 // みゅ diff --git a/handsdown/vb2-adaptive.c b/handsdown/vb2-adaptive.c index 8b56d43..520372f 100755 --- a/handsdown/vb2-adaptive.c +++ b/handsdown/vb2-adaptive.c @@ -9,6 +9,15 @@ which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Vibranium-vb (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ X W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen +// Z │ B P L D V │ [ copy pste ] │ -+ U O Y F │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { @@ -29,24 +38,11 @@ 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 + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ - case KC_C: - switch (prior_keycode) { - case KC_T: // roll for tch - send_string("ch"); // 85% of tc is tch, so this saves a lot of key press "H" - return_state = false; // done. - break; - case KC_B: // eliminate BS SFB (BS is 23x more common than BC) - tap_code(KC_S); // - return_state = false; // done. - break; - } - break; - case KC_B: switch (prior_keycode) { case KC_P: // avoid row step (PS is 40x more common than PB) @@ -58,30 +54,18 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_M: // M becomes L (pull up "L" to same row) + case KC_C: switch (prior_keycode) { - case KC_G: // pull up "L" (GL is 5x more common than GM) - case KC_X: // pull up "L" (XL is 1.5x more common than XM) - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + case KC_T: // roll for tch + send_string("ch"); // 85% of tc is tch, so this saves a lot of key press "H" + return_state = false; // done. + break; + case KC_B: // eliminate BS SFB (BS is 23x more common than BC) + tap_code(KC_S); // return_state = false; // done. break; - case KC_W: // WM = LM (LM 20x more common) - if (!preprior_keycode) { - tap_code(KC_BSPC); - tap_code(KC_L); - break; - } - switch (preprior_keycode) { - case KC_M: - case KC_X: - tap_code(KC_L); - return_state = false; // done. - break; - }; } break; - case KC_D: // (for KD=KL; least code, no side effects) switch (prior_keycode) { // case KC_K: @@ -101,32 +85,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } } break; - - case KC_L: // catch this so we can unshift L on these rolls. - switch (prior_keycode) { - case KC_P: - case KC_B: // - case KC_S: // - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) - return_state = false; // done. - break; - } - break; - - case KC_W: // W becomes P (pull up "P" to same row) - switch (prior_keycode) { - case KC_X: // pull up P (W becomes P after X to set up "xp"+l) - case KC_M: // pull up P (W becomes P after M to set up "mp"+l) - tap_code(KC_P); // pull up P from bottom row. - return_state = false; // done. - break; - case KC_G: - tap_code(KC_D); // eliminate SFB on index - return_state = false; // done. - break; - } - break; - case KC_G: switch (prior_keycode) { case KC_K: @@ -147,57 +105,99 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_T: // alt fingering remedy for middle-index splits + case KC_J: switch (prior_keycode) { - case KC_K: // quickly typing "k?" yields "kn" (+48x) - tap_code(KC_N); + case KC_G: // 99.7% of GT are followed by H + send_string("th"); // as in "length" return_state = false; // done. break; + case KC_M: // Eliminate MN SFB + tap_code(KC_L); // MJ = ML (43.43 126965511) + return_state = false; // done. + break; + case KC_V: // Eliminate VL Scissor + case KC_W: // Eliminate WL scissor + tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) + return_state = false; // done. + break; + } + // 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_D: // eliminate index-middle stretch with alt fingering + case KC_G: + tap_code(KC_BSPC); // replace D/G + tap_code(KC_L); // D/GK = LK (LK ismore common than D/GK) + break; // Send K normally + case KC_T: // eliminate lateral stretch + tap_code(KC_BSPC); // replace T + tap_code(KC_C); // HK = CK + break; // Send K normally } break; - - case KC_K: // remedy ring-index split by shifting fingering + case KC_L: // catch this so we can unshift L on these rolls. switch (prior_keycode) { - case KC_T: // TK = CK (>282x) - tap_code(KC_BSPC); - tap_code(KC_C); + case KC_P: + case KC_B: // + case KC_S: // + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + return_state = false; // done. break; } - // falling through here intentionally here. V&K are treated same. - case KC_V: // remedy inner column split by shifting fingering - switch (prior_keycode) { - case KC_D: // DV/TV/GV = LV () - 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 - } break; - - case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB + case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { - case KC_L: // quickly typing "lr" yields "ll" (+56x) - tap_code(KC_L); + case KC_G: // pull up "L" (GL is 5x more common than GM) + case KC_X: // pull up "L" (XL is 1.5x more common than XM) + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. break; + case KC_W: // WM = LM (LM 20x more common) + if (!preprior_keycode) { + tap_code(KC_BSPC); + tap_code(KC_L); + break; + } + switch (preprior_keycode) { + case KC_M: + case KC_X: + tap_code(KC_L); + return_state = false; // done. + break; + }; } break; - - case KC_X: + // If not using H-digraph combos, consider this adaptive solution? +#ifndef EN_HDIGRAPH_COMBOS + case KC_N: // N becomes H (for H-Digraph rolls) switch (prior_keycode) { - case KC_M: // "MB" is 2558x more frequent than "MX" - tap_code(KC_B); // pull up B from bottom row. + case KC_P: // pn = ph (ph 78x more common) + case KC_G: // gn = gh (gh 2.5x more common) + case KC_S: // sn = sh (sh 33x more common) + case KC_W: // wn = wh (wh 3.8x more common) + case KC_C: // cn = ch (sh 694x more common) + case KC_T: // tn = th (LM 354x more common) + tap_code(KC_H); return_state = false; // done. - break; - case KC_G: // "GX" is 778x more frequent than "GT" - tap_code(KC_T); // eliminate GT SFB. + } + break; +#else + case KC_N: // N becomes H (for H-Digraph rolls) + switch (prior_keycode) { + case KC_T: // "TION" is 58x more common than "TN" + send_string("ion"); return_state = false; // done. break; + case KC_X: // xn = ln (LN 101x more common) + tap_code(KC_BSPC); + tap_code(KC_L); + return_state = true; // let the N happen. + break; } break; - +#endif case KC_P: switch (prior_keycode) { case KC_D: // DP = DT eliminate SFB (DT is 2.5x more common) @@ -211,149 +211,76 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - -/* -// right hand adaptives -*/ - - case KC_QUOT: + case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" + case KC_L: // quickly typing "lr" yields "ll" (+56x) + tap_code(KC_L); return_state = false; // done. break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif } break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_A: // AE is a fraction less common, but I find the EAE trill harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (8x more common) - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) + case KC_T: // alt fingering remedy for middle-index splits + switch (prior_keycode) { + case KC_K: // quickly typing "k?" yields "kn" (+48x) + tap_code(KC_N); return_state = false; // done. break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) + } + break; + case KC_V: // remedy inner column split by shifting fingering + switch (prior_keycode) { + case KC_D: // DV/TV/GV = LV () + 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_W: // W becomes P (pull up "P" to same row) + switch (prior_keycode) { + case KC_X: // pull up P (W becomes P after X to set up "xp"+l) + case KC_M: // pull up P (W becomes P after M to set up "mp"+l) + tap_code(KC_P); // pull up P from bottom row. return_state = false; // done. break; - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) + case KC_G: + tap_code(KC_D); // eliminate SFB on index 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) + } + break; + case KC_X: + switch (prior_keycode) { + case KC_M: // "MB" is 2558x more frequent than "MX" + tap_code(KC_B); // pull up B from bottom row. return_state = false; // done. break; - case KC_J: // j'habite - case KC_L: // l'hôtel - case KC_M: // m'homme - case KC_N: // n'habite - case KC_D: // d'habitude - tap_code(KC_QUOT);// eliminate 'h SFB for French - break;// (can't do it for T bc Th, unless Th digraph combo is mandatory…) - case KC_Y: // - tap_code(KC_QUOT); // YH = Y' (pull down to avoid ring-pinky scissor) + case KC_G: // "GX" is 778x more frequent than "GT" + tap_code(KC_T); // eliminate GT SFB. return_state = false; // done. break; - } break; + +/* +// right hand adaptives +*/ + case KC_F: - switch (prior_keycode) { - case KC_Y: // - tap_code(KC_I); // YF = YI (eliminate SFB on ring finger YI is 37x YF) + 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. break; } break; - -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) + +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/vb2-config.h b/handsdown/vb2-config.h index 088adc1..d2914ae 100644 --- a/handsdown/vb2-config.h +++ b/handsdown/vb2-config.h @@ -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 @@ -169,13 +169,13 @@ #define HD_copy_keys HD_LB3, HD_LB2 // copy (hold for cut) #define HD_pste_keys HD_LB2, HD_LB1 // paste (hold for paste-match) -#define HD_tab_keys HD_LT4, HD_LT3 // tab -#define HD_stab_keys HD_LT4, HD_LT3, HD_LT2 // Shift-tab -#define HD_spc_keys HD_LM1, HD_LM0 // SPACE -#define HD_ent_keys HD_LB0, HD_LB1 // ENTER -#define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break -#define APPMENU_keys HD_LT1, HD_LT0 // APPMENU -#define APPMENU_nav_keys LN_LT1, LN_LT0 // APPMENU +#define HD_tab_keys HD_LT4, HD_LT3 // tab +#define HD_stab_keys HD_LT4, HD_LT3, HD_LT2 // Shift-tab +#define HD_spc_keys HD_LM1, HD_LM0 // SPACE +#define HD_ent_keys HD_LB0, HD_LB1 // ENTER +#define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break +#define APPMENU_keys HD_LT1, HD_LT0 // APPMENU on alpha layer +#define APPMENU_nav_keys LV_LT1, LV_LT0 // APPMENU on Nav layer // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // diff --git a/handsdown/vf-adaptive.c b/handsdown/vf-adaptive.c index e2f037d..7b1f68d 100755 --- a/handsdown/vf-adaptive.c +++ b/handsdown/vf-adaptive.c @@ -1,19 +1,28 @@ /* Adaptive Keys - Called from within process_record_user + Called from early within process_record_user - Tailored for HD Vibranium-b (vb) + Tailored for HD Vibranium-f (vf) NOTE: assumed dual-function keys (MOD_TAP, LAYER_TAP) have already been handled AND FILTERED OUT! The combos handler will have already taken out combo candidates, which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Vibranium-vf (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ X W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen +// Z │ F P L D V │ [ copy pste ] │ -+ U O Y B │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { bool return_state = true; // assume we don't do anything. - + // Are we in an adaptive context? (adaptive on is assumed). if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM) { // outside adaptive threshhold prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives. @@ -29,7 +38,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 + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) @@ -42,38 +51,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_F: - switch (prior_keycode) { - case KC_P: // avoid row step (PS is 36x more common than PF) - tap_code(KC_S); - return_state = false; // done. - } - break; - - case KC_M: // M becomes L (pull up "L" to same row) - switch (prior_keycode) { - case KC_G: // pull up "L" (GL is 5x more common than GM) - case KC_X: // pull up "L" (XL is 1.5x more common than XM) - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) - return_state = false; // done. - break; - case KC_W: // WM = LM (LM 20x more common) - if (!preprior_keycode) { - tap_code(KC_BSPC); - tap_code(KC_L); - break; - } - switch (preprior_keycode) { - case KC_M: - case KC_X: - tap_code(KC_L); - return_state = false; // done. - break; - }; - } - break; - case KC_D: // (for KD=KL; least code, no side effects) switch (prior_keycode) { // case KC_K: @@ -89,103 +66,138 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } } break; - - case KC_L: // catch this so we can unshift L on these rolls. - switch (prior_keycode) { - case KC_P: - case KC_B: // - case KC_S: // - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) - return_state = false; // done. - break; - } - break; - - case KC_W: // W becomes P (pull up "P" to same row) + case KC_F: switch (prior_keycode) { - case KC_X: // pull up P (W becomes P after X to set up "xp"+l) - case KC_M: // pull up P (W becomes P after M to set up "mp"+l) - tap_code(KC_P); // pull up P from bottom row. + case KC_D: // eliminate DT SFB + tap_code(KC_T); return_state = false; // done. break; - case KC_G: - tap_code(KC_D); // eliminate SFB on index + case KC_P: // avoid row step (PS is 36x more common than PF) + tap_code(KC_S); return_state = false; // done. break; } break; - case KC_G: switch (prior_keycode) { - case KC_K: + case KC_J: // roll JG => jpg free letter! + tap_code(KC_P); // insert a P + break; // and let current keycode send normally + case KC_K: // eliminate index-middle stretch with alt fingering tap_code(KC_L); // pull up "L" (KL is 5x more common than KG) return_state = false; // done. break; - case KC_M: - tap_code(KC_BSPC); - tap_code(KC_L); - break; // and let current keycode send normally - case KC_J: // JG = jpg - tap_code(KC_P); // insert a P + case KC_M: // eliminate scissor + if (preprior_keycode == KC_W) { // to roll WMG -> lml? (no side effects?) + tap_code(KC_L); // G kecomes L for "LML" + return_state = false; // done. + break; // and let current keycode send normally + } + tap_code(KC_BSPC); // replace M + tap_code(KC_L); // "pull up" L to eliminate scissor break; // and let current keycode send normally case KC_W: - tap_code(KC_BSPC); - send_string("lml"); // for "calmly" though not quite intuitive… + tap_code(KC_D); // pull up D (WD is 35x more common than WG) return_state = false; // done. break; } break; - - case KC_T: // alt fingering remedy for middle-index splits + case KC_J: switch (prior_keycode) { - case KC_K: // quickly typing "k?" yields "kn" (+48x) - tap_code(KC_N); + case KC_G: // 99.7% of GT are followed by H + send_string("th"); // as in "length" + return_state = false; // done. + break; + case KC_M: // Eliminate MN SFB + tap_code(KC_L); // MJ = ML (43.43 126965511) + return_state = false; // done. + break; + case KC_V: // Eliminate VL Scissor + case KC_W: // Eliminate WL scissor + tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) return_state = false; // done. break; } break; - - case KC_K: // remedy ring-index split by shifting fingering + // 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 (>282x) - tap_code(KC_BSPC); - tap_code(KC_C); - break; + case KC_D: // eliminate index-middle stretch with alt fingering + case KC_G: + tap_code(KC_BSPC); // replace D/G + tap_code(KC_L); // D/GK = LK (LK ismore common than D/GK) + break; // Send K normally + case KC_T: // eliminate lateral stretch + tap_code(KC_BSPC); // replace T + tap_code(KC_C); // HK = CK + break; // Send K normally } - // falling through here intentionally here. V&K are treated same. - case KC_V: // remedy inner column split by shifting fingering - switch (prior_keycode) { - case KC_D: // DV/TV/GV = LV () - 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 - } break; - - case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB + case KC_L: // catch this so we can unshift L on these involving pinky/ring rolls. switch (prior_keycode) { - case KC_L: // quickly typing "lr" yields "ll" (+56x) - tap_code(KC_L); + case KC_P: + case KC_B: // + case KC_S: // + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. break; } break; - - case KC_X: + case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { - case KC_M: // "MB" is 2558x more frequent than "MX" - tap_code(KC_B); // pull up B from bottom row. + case KC_G: // pull up "L" (GL is 5x more common than GM) + case KC_X: // pull up "L" (XL is 1.5x more common than XM) + case KC_C: // step for upper column pref (CL is 7.6x more common than CM) + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. break; - case KC_G: // "GX" is 778x more frequent than "GT" - tap_code(KC_T); // eliminate GT SFB. + case KC_W: // WM = LM (LM 20x more common) + switch (preprior_keycode) { + case KC_M: // for lml + case KC_X: // for xpl + tap_code(KC_L); + return_state = false; // done. + break; + default: + tap_code(KC_BSPC); + send_string("lm"); + return_state = false; // done. + break; + } + break; + } + break; + // If not using H-digraph combos, consider this adaptive solution? +#ifndef EN_HDIGRAPH_COMBOS + case KC_N: // N becomes H (for H-Digraph rolls) + switch (prior_keycode) { + case KC_P: // pn = ph (ph 78x more common) + case KC_G: // gn = gh (gh 2.5x more common) + case KC_S: // sn = sh (sh 33x more common) + case KC_W: // wn = wh (wh 3.8x more common) + case KC_C: // cn = ch (sh 694x more common) + case KC_T: // tn = th (LM 354x more common) + tap_code(KC_H); + return_state = false; // done. + } + break; +#else + case KC_N: // N becomes H (for H-Digraph rolls) + switch (prior_keycode) { + case KC_T: // "TION" is 58x more common than "TN" + send_string("ion"); return_state = false; // done. break; + case KC_X: // xn = ln (LN 101x more common) + tap_code(KC_BSPC); + tap_code(KC_L); + return_state = true; // let the N happen. + break; } break; - +#endif case KC_P: switch (prior_keycode) { case KC_D: // DP = DT eliminate SFB (DT is 2.5x more common) @@ -195,158 +207,89 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { case KC_F: // Pull S down (SP is 860x more common than FP) tap_code(KC_BSPC); tap_code(KC_S); //(but maybe should be BS? SP/BS are about equal...) - return_state = true; // not done (process this key normally) break; } break; - - -/* -// right hand adaptives -*/ - - case KC_QUOT: + case KC_T: // alt fingering remedy for middle-index splits switch (prior_keycode) { - case KC_DOT: - send_string("org"); + case KC_K: // quickly typing "k?" yields "kn" (+48x) + tap_code(KC_N); return_state = false; // done. break; - case KC_SLSH: + } + break; + case KC_V: // remedy inner column split by shifting fingering + switch (prior_keycode) { + case KC_D: // DV/TV/GV = LV () + case KC_T: // TK/DK/GK = LK () + case KC_G: // tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" + tap_code(KC_L); + break; // and let current keycode send normally + } + break; + case KC_W: // W becomes P (pull up "P" to same row) + switch (prior_keycode) { + case KC_G: + tap_code(KC_D); // eliminate SFB on index return_state = false; // done. break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" + case KC_M: // pull up P (W becomes P after M to set up "mp"+l) + if (preprior_keycode == KC_W) { // except for WMW -> lml? + tap_code(KC_L); // replace the W with L + return_state = false; // done. + break; + } // drop through! + case KC_W: // WW doesn't exist, so to permit PP after M... + case KC_X: // pull up P (W becomes P after X to set up "xp"+l) + tap_code(KC_P); // pull up P from bottom row. return_state = false; // done. break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" + case KC_N: // avoid SFB (NL is 10x more common than NW) + tap_code(KC_L); return_state = false; // done. break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif } break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_A: // AE is a fraction less common, but I find the EAE trill harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (8x more common) - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) + case KC_X: + switch (prior_keycode) { + case KC_G: // eliminate GT SFB. + tap_code(KC_T); // "GT" is 778x more frequent than "GX" 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) + case KC_M: // eliminate MF scissor. + tap_code(KC_F); // "MF" is x more frequent than "MX" return_state = false; // done. break; - case KC_J: // j'habite - case KC_L: // l'hôtel - case KC_M: // m'homme - case KC_N: // n'habite - case KC_D: // d'habitude - tap_code(KC_QUOT);// eliminate 'h SFB for French - break;// (can't do it for T bc Th, unless Th digraph combo is mandatory…) - case KC_Y: // - tap_code(KC_QUOT); // YH = Y' (pull down to avoid ring-pinky scissor) + case KC_W: // eliminate WS scissor. + tap_code(KC_S); // return_state = false; // done. break; - } break; +/* +// right hand adaptives +*/ + case KC_B: switch (prior_keycode) { - case KC_Y: // - tap_code(KC_I); // YB = YI (eliminate SFB on ring finger YI is 5x YB) - return_state = false; // done. - break; + case KC_Y: // avoid ring->pinky scissor + tap_code(KC_BSPC); + tap_code(KC_I); + break; // process the B normally } break; - -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) + +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. set_mods(saved_mods); - prior_keycode = preprior_keycode = keycode = 0; } return return_state; // } diff --git a/handsdown/vf-config.h b/handsdown/vf-config.h index 7cc7eb6..3344359 100644 --- a/handsdown/vf-config.h +++ b/handsdown/vf-config.h @@ -59,11 +59,11 @@ // LH5 LH4 LH3 ╰─────────╯ ╰─────────╯ RH3 RH4 RH5 // // -// Base (alpha) Layer Hands Down Vibranium-vb (HRMs /+ thumb mods) +// Base (alpha) Layer Hands Down Vibranium-vf (HRMs /+ thumb mods) // ╭─────────────────────╮ ╭─────────────────────╮ // esc │ X W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk // tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen -// Z │ B P L D V │ [ copy pste ] │ -+ U O Y F │ Q +// Z │ F P L D V │ [ copy pste ] │ -+ U O Y B │ Q // ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ // left rght app ╰─────────╯ ╰──────────╯ tgLN up dn // @@ -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 @@ -304,9 +304,9 @@ //#define JP_fye_keys HD_RM4, HD_RB1 // ふぇ //#define JP_fyo_keys HD_RM4, HD_RB2 // ふぉ -#define JP_bya_keys HD_LB4, HD_RM1 // びゃ -#define JP_byu_keys HD_LB4, HD_RB1 // びゅ conflicts with diacritic? -#define JP_byo_keys HD_LB4, HD_RB2 // びょ +#define JP_bya_keys HD_RB4, HD_RM1 // びゃ +#define JP_byu_keys HD_RB4, HD_RB1 // びゅ conflicts with diacritic? +#define JP_byo_keys HD_RB4, HD_RB2 // びょ #define JP_mya_keys HD_LT2, HD_RM1 // みゃ #define JP_myu_keys HD_LT2, HD_RB1 // みゅ #define JP_myo_keys HD_LT2, HD_RB2 // みょ diff --git a/handsdown/vv-adaptive.c b/handsdown/vv-adaptive.c index bb751cb..0844cb8 100755 --- a/handsdown/vv-adaptive.c +++ b/handsdown/vv-adaptive.c @@ -9,14 +9,22 @@ which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Vibranium-vv (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ V W M G J │ L_CFG L_NUM │ #$ .: '[ "] B │ LANG2/henk +// tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen +// Z │ X P L D /* │ [ copy pste ] │ -+ U O Y F │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { bool return_state = true; // assume we don't do anything. - + // Are we in an adaptive context? (adaptive on is assumed). - if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM - || ((keycode == KC_SLSH) && (timer_elapsed(prior_keydown) > ADAPTIVE_TERM * 16))) { + if (timer_elapsed(prior_keydown) > ADAPTIVE_TERM) { // outside adaptive threshhold prior_keycode = preprior_keycode = prior_keydown = 0; // turn off Adaptives. return true; // no adaptive conditions, so return. } @@ -28,48 +36,48 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { unregister_mods(MOD_MASK_SHIFT); //CAPS_WORD/LOCK won't be affected. } // may want more granular control than this… - switch (keycode & QK_BASIC_MAX) { // process ignoring multi-function keys +// switch (((keycode >= SAFE_RANGE) && (keycode <= SemKeys_COUNT)) ? (keycode) : (keycode & QK_BASIC_MAX)) { // only handling normal, SHFT or ALT cases. + + switch (keycode) { // process ignoring multi-function keys & shift state? /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ - case KC_M: // M becomes L (pull up "L" to same row) + case KC_C: switch (prior_keycode) { - case KC_G: // pull up "L" (GL is 5x more common than GM) - case KC_X: // pull up "L" (XL is 1.5x more common than XM) + case KC_T: // roll for tch + send_string("ch"); // 85% of tc is tch, so this saves a lot of "H" key presses + return_state = false; // done. + break; + } + break; + case KC_D: // (for KD=KL; least code, no side effects) + switch (prior_keycode) { // + case KC_K: + case KC_V: tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. break; - case KC_W: // WM = LM (LM 20x more common) - if (!preprior_keycode) { + case KC_L: + if (preprior_keycode == KC_P) { // PLD = PWD? tap_code(KC_BSPC); - tap_code(KC_L); - break; + tap_code(KC_W); // replace the L with W + break; // process the D normally } - switch (preprior_keycode) { - case KC_M: - case KC_X: - tap_code(KC_L); - return_state = false; // done. - break; - }; } break; - - case KC_W: // W becomes P (pull up "P" to same row) + case KC_F: switch (prior_keycode) { - case KC_X: // pull up P (W becomes P after X to set up "xp"+l) - case KC_M: // pull up P (W becomes P after M to set up "mp"+l) - tap_code(KC_P); // pull up P from bottom row. + case KC_D: // + tap_code(KC_G); // eliminate SFB (DG is 10x more common than DF) return_state = false; // done. break; - case KC_G: - tap_code(KC_D); // eliminate SFB on index - return_state = false; // done. + case KC_V: // + tap_code(KC_BSPC); + tap_code(KC_S); // avoid row step (311x more common than VF) break; } break; - case KC_G: switch (prior_keycode) { case KC_K: @@ -90,23 +98,37 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_D: // (for KD=KL; least code, no side effects) - switch (prior_keycode) { // - case KC_K: - case KC_V: - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + case KC_J: + switch (prior_keycode) { + case KC_G: // 99.7% of GT are followed by H + send_string("th"); // as in "length" + return_state = false; // done. + break; + case KC_M: // Eliminate MN SFB + tap_code(KC_L); // MJ = ML (43.43 126965511) + return_state = false; // done. + break; + case KC_W: // Eliminate WL scissor + tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) return_state = false; // done. break; - case KC_L: - if (preprior_keycode == KC_P) { // PLD = PWD? - tap_code(KC_BSPC); - tap_code(KC_W); // replace the L with W - break; // process the D normally - } + } + // 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_D: // eliminate index-middle stretch with alt fingering + case KC_G: + tap_code(KC_BSPC); // replace D/G + tap_code(KC_L); // D/GK = LK (LK ismore common than D/GK) + break; // Send K normally + case KC_T: // eliminate lateral stretch + tap_code(KC_BSPC); // replace T + tap_code(KC_C); // HK = CK + break; // Send K normally } break; - case KC_L: // catch this so we can unshift L on these rolls. switch (prior_keycode) { case KC_P: @@ -116,71 +138,94 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - - case KC_T: // alt fingering remedy for middle-index splits + case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { - case KC_K: // quickly typing "k?" yields "kn" (+48x) - tap_code(KC_N); + case KC_G: // pull up "L" (GL is 5x more common than GM) + case KC_X: // pull up "L" (XL is 1.5x more common than XM) + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) return_state = false; // done. break; + case KC_W: // WM = LM (LM 20x more common) + if (!preprior_keycode) { + tap_code(KC_BSPC); + tap_code(KC_L); + break; + } + switch (preprior_keycode) { + case KC_M: + case KC_X: + tap_code(KC_L); + return_state = false; // done. + break; + }; } break; - - case KC_C: + // If not using H-digraph combos, consider this adaptive solution? +#ifndef EN_HDIGRAPH_COMBOS + case KC_N: // N becomes H (for H-Digraph rolls) switch (prior_keycode) { - case KC_T: // roll for tch - send_string("ch"); // 85% of tc is tch, so this saves a lot of "H" key presses + case KC_P: // pn = ph (ph 78x more common) + case KC_G: // gn = gh (gh 2.5x more common) + case KC_S: // sn = sh (sh 33x more common) + case KC_W: // wn = wh (wh 3.8x more common) + case KC_C: // cn = ch (sh 694x more common) + case KC_T: // tn = th (LM 354x more common) + tap_code(KC_H); return_state = false; // done. - break; } break; - - case KC_F: +#else + case KC_N: // N becomes H (for H-Digraph rolls) switch (prior_keycode) { - case KC_D: // - tap_code(KC_G); // eliminate SFB (DG is 10x more common than DF) + case KC_T: // "TION" is 58x more common than "TN" + send_string("ion"); return_state = false; // done. break; - case KC_V: // + case KC_X: // xn = ln (LN 101x more common) tap_code(KC_BSPC); - tap_code(KC_S); // avoid row step (311x more common than VF) + tap_code(KC_L); + return_state = true; // let the N happen. break; } break; - - case KC_V: +#endif + case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB switch (prior_keycode) { - case KC_F: // avoid row step (91x more frequent) - tap_code(KC_S); + case KC_L: // quickly typing "lr" yields "ll" (+56x) + tap_code(KC_L); return_state = false; // done. break; } break; - - case KC_K: // remedy ring-index split by shifting fingering + case KC_T: // alt fingering remedy for middle-index splits switch (prior_keycode) { - case KC_T: // TK/DK/GK = CK (252x more frequent) - tap_code(KC_BSPC); - tap_code(KC_C); + case KC_K: // quickly typing "k?" yields "kn" (+48x) + tap_code(KC_N); + return_state = false; // done. break; - case KC_D: // DK = LK (11x more frequent) - case KC_G: // GK = LK (74x more frequent) - tap_code(KC_BSPC); - tap_code(KC_L); + } + break; + case KC_W: // W becomes P (pull up "P" to same row) + switch (prior_keycode) { + case KC_X: // pull up P (W becomes P after X to set up "xp"+l) + case KC_M: // pull up P (W becomes P after M to set up "mp"+l) + tap_code(KC_P); // pull up P from bottom row. + return_state = false; // done. + break; + case KC_G: + tap_code(KC_D); // eliminate SFB on index return_state = false; // done. break; - } + } break; - - case KC_R: // LL is the highest consonant repeat, and it's off home, so eliminate this SFB + case KC_V: switch (prior_keycode) { - case KC_L: // quickly typing "lr" yields "ll" (+56x) - tap_code(KC_L); + case KC_F: // avoid row step (91x more frequent) + tap_code(KC_S); return_state = false; // done. break; } break; - case KC_X: switch (prior_keycode) { case KC_W: // eliminate scissor (2818x gain) @@ -203,176 +248,29 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; - case KC_SLSH: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - } - break; - - case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? - case KC_A: // AE is a fraction less common, but I find the EAE trill harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (8x more common, eliminates SFB) - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB) - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) - return_state = false; // done. - break; - case KC_I: // avoid row skip on outward pinky roll - tap_code(KC_P); // "IH" yields "IP" (41x more common) - return_state = false; // done. - break; - - } - break; - case KC_P: switch (prior_keycode) { case KC_Y: // tap_code(KC_I); // YP = YI (eliminate SFB on ring finger YI is 37x YF) return_state = false; // done. - break; + break; } break; - case KC_DQUO: - switch (prior_keycode) { - case KC_B: // - tap_code(KC_Y); // BJ = BY (eliminate scissor on ring finger BY is 6x BJ) - return_state = false; // done. - break; - case KC_DOT: - send_string("edu"); - return_state = false; // done. - break; - } - break; - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - break; - case KC_QUOT: // - case KC_B: // - tap_code(KC_O); // (eliminate scissor) - return_state = false; // done. - break; - } - break; - case KC_DOT: - switch (prior_keycode) { - case KC_QUOT: // This could be smarter (only after O rolled up) - case KC_B: // - tap_code(KC_U); // (eliminate scissor) - return_state = false; // done. - break; - } - break; - case KC_B: - switch (prior_keycode) { - case KC_DOT: - tap_code(KC_BSPC); - send_string(".org"); - return_state = false; // done. + case KC_B: + switch (prior_keycode) { + case KC_DOT: + tap_code(KC_BSPC); + send_string(".org"); + return_state = false; // done. break; - } + } break; +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) - -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // Any alpha can be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) { // no adaptive processed, cancel state and pass it on. diff --git a/handsdown/vv-config.h b/handsdown/vv-config.h index 8f81156..a6635f2 100644 --- a/handsdown/vv-config.h +++ b/handsdown/vv-config.h @@ -59,11 +59,11 @@ // LH5 LH4 LH3 ╰─────────╯ ╰─────────╯ RH3 RH4 RH5 // // -// Base (alpha) Layer Hands Down Vibranium-vv (HRMs /+ thumb mods) +// Base (alpha) Layer Hands Down Vibranium-Vv (HRMs /+ thumb mods) // ╭─────────────────────╮ ╭─────────────────────╮ // esc │ V W M G J │ L_CFG L_NUM │ #$ .: '[ "] B │ LANG2/henk // tab │ S C N T K | ( ) | ,; A E I H │ LANG1/mhen -// Z │ X P L D /* │ [ copy pste ] │ -+ U O Y F │ Q +// Z │ X F L D /* │ [ copy pste ] │ -+ U O Y P │ Q // ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ // left rght app ╰─────────╯ ╰──────────╯ tgLN up dn // @@ -83,7 +83,7 @@ #define HD_RT1 HD_DOT #define HD_RT2 HD_QUOT #define HD_RT3 HD_DQUO -#define HD_RT4 HD_ +#define HD_RT4 HD_B #define HD_RT5 KC_LNG2 #define HD_LM5 KC_TAB diff --git a/handsdown/vx-adaptive.c b/handsdown/vx-adaptive.c index 60afd55..389a43a 100755 --- a/handsdown/vx-adaptive.c +++ b/handsdown/vx-adaptive.c @@ -9,6 +9,15 @@ which have a shorter keydown threshhold (COMBO_TERM). */ +// Base (alpha) Layer Hands Down Vibranium-vx (HRMs /+ thumb mods) +// ╭─────────────────────╮ ╭─────────────────────╮ +// esc │ V W M G J │ L_CFG L_NUM │ #$ .: /* "[ '] │ LANG2/henk +// tab │ S C N T B | ( ) | ,; A E I H │ LANG1/mhen +// Z │ X P L D K │ [ copy pste ] │ -+ U O Y F │ Q +// ╰───────────╮ bsp R │ & | │ spc ret ╭──────────╯ +// left rght app ╰─────────╯ ╰──────────╯ tgLN up dn +// +// For small boards, Q (LT3) & Z (LT4) are (also) on the sym layer bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { @@ -30,6 +39,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) { // process ignoring multi-function keys & shift state? + /* // Left hand adaptives (most are single-handed neighbor fingers, bc speed, dexterity limits) */ @@ -40,7 +50,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { tap_code(KC_L); return_state = true; // done. break; -// case KC_P: // avoid scissor (MB is 67x more common than PB) case KC_T: // avoid scissor (MB is 34x more common than TB) case KC_X: // avoid scissor (MB is 1174x more common than XB) tap_code(KC_BSPC); @@ -95,6 +104,49 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; + case KC_J: + switch (prior_keycode) { + case KC_G: // "GTH" is an awkward trigram/skipgram + send_string("th"); // for "length" + return_state = false; // done. + break; + case KC_M: // Eliminate MN Scissor (still same fingers) + tap_code(KC_B); // MJ = mn (MB is 869x more common than MJ) + return_state = false; // done. + break; + case KC_W: // Eliminate WL scissor (still same fingers) + tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) + return_state = false; // done. + break; + } + break; + // 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_D: // eliminate index-middle stretch with alt fingering + case KC_G: + tap_code(KC_BSPC); // replace D/G + tap_code(KC_L); // D/GK = LK (LK ismore common than D/GK) + break; // Send K normally + case KC_T: // eliminate lateral stretch + tap_code(KC_BSPC); // replace T + tap_code(KC_C); // HK = CK + break; // Send K normally + } + break; + case KC_L: // catch this so we can unshift L on these rolls. + switch (prior_keycode) { + case KC_B: + case KC_C: + case KC_P: + case KC_S: + tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) + return_state = false; // done. + break; + } + break; case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { case KC_G: // eliminate scissor (GL is 5x more common than GM) @@ -114,32 +166,10 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { send_string("lm"); return_state = false; // done. break; - } - } - break; - case KC_W: // W becomes P (pull up "P" to same row) - switch (prior_keycode) { - case KC_M: // pull up P (W becomes P after M to set up "mp"+l) - if (preprior_keycode == KC_W) { // except for WMW -> lml? - tap_code(KC_L); // replace the W with L - return_state = false; // done. - break; - } // drop through! - case KC_W: // WW doesn't exist, so to permit PP after M... - tap_code(KC_P); // pull up P from bottom row. - return_state = false; // done. - break; - case KC_G: - 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; - // If not using H-digraph combos, consider this adaptive solution? #ifndef EN_HDIGRAPH_COMBOS case KC_N: // N becomes H (for H-Digraph rolls) @@ -168,7 +198,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } break; #endif - case KC_P: switch (prior_keycode) { case KC_D: // DP = DT eliminate SFB (DT is 2.5x more common) @@ -185,22 +214,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; - // 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_G: // eliminate index-middle stretch with alt fingering - tap_code(KC_BSPC); // replace G - tap_code(KC_L); // GK = LK (LK is 75x more common than GK) - break; // Send K normally - case KC_T: - tap_code(KC_BSPC); // replace D - tap_code(KC_C); // DK = CK (CK is 348x more common than DK) - break; // Send K normally - } - break; - case KC_V: switch (prior_keycode) { case KC_G: // "GT" is 363x more frequent than "GV" @@ -213,6 +226,28 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { break; } break; + case KC_W: // W becomes P (pull up "P" to same row) + switch (prior_keycode) { + case KC_M: // pull up P (W becomes P after M to set up "mp"+l) + if (preprior_keycode == KC_W) { // except for WMW -> lml? + tap_code(KC_L); // replace the W with L + return_state = false; // done. + break; + } // drop through! + case KC_W: // WW doesn't exist, so to permit PP after M... + tap_code(KC_P); // pull up P from bottom row. + return_state = false; // done. + break; + case KC_G: + 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_X: switch (prior_keycode) { case KC_L: // eliminate LV scissor. @@ -234,33 +269,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } break; - case KC_J: - switch (prior_keycode) { - case KC_G: // "GTH" is an awkward trigram/skipgram - send_string("th"); // for "length" - return_state = false; // done. - break; - case KC_M: // Eliminate MN Scissor (still same fingers) - tap_code(KC_B); // MJ = mn (MB is 869x more common than MJ) - return_state = false; // done. - break; - case KC_W: // Eliminate WL scissor (still same fingers) - tap_code(KC_L); // WJ = wl (WL is 468x more common than WJ) - return_state = false; // done. - break; - } - break; - - case KC_L: // catch this so we can unshift L on these involving pinky/ring rolls. - switch (prior_keycode) { - case KC_P: - case KC_B: // - case KC_S: // - tap_code(KC_L); // pull up "L" (PL is 15x more common than PM) - return_state = false; // done. - break; - } - break; @@ -268,155 +276,6 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { // right hand adaptives */ - case KC_QUOT: - switch (prior_keycode) { - case KC_DOT: - send_string("org"); - return_state = false; // done. - break; -#ifndef ADAPT_VOWEL_H - case KC_A: // - tap_code(KC_U); // "A'" yields "AU" - return_state = false; // done. - break; - case KC_U: - tap_code(KC_A); // "U'" yields "UA" - return_state = false; // done. - break; - case KC_E: - tap_code(KC_O); // "E'" yields "EO" - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "O'" yields "OE" - return_state = false; // done. - break; -/*#else // regain v-H rolls (kludgy? unnecessary?) - case KC_A: - case KC_U: - case KC_E: - case KC_O: - case KC_I: - tap_code(KC_H); // "IH" yields "IF" (96x more common) - return_state = false; // done. -*/ -#endif - } - break; - case KC_SLSH: - switch (prior_keycode) { - case KC_DOT: - send_string("com"); - return_state = false; // done. - } - break; - case KC_DQUO: - switch (prior_keycode) { - case KC_DOT: - send_string("edu"); - return_state = false; // done. - break; - case KC_SLSH: // /" => ? - tap_code(KC_BSPC); - tap_code16(KC_QUES); - return_state = false; // done. - } - break; - case KC_COMM: - switch (prior_keycode) { - case KC_COMM: // double comma = CAPS_WORD. - tap_code(KC_BSPC); - toggle_caps_word(); - return_state = false; // done. - break; - } - break; - case KC_DOT: - switch (prior_keycode) { - case KC_SLSH: // /. => ! - tap_code(KC_BSPC); - tap_code16(KC_EXLM); - return_state = false; // done. - break; - } - break; - -#ifdef ADAPT_VOWEL_H -#if defined(ADAPT_AE_AU) || defined(DE_ADAPTIVES) // AU is really common in German (and influences EN/FR) - case KC_E: - switch (prior_keycode) { - case KC_A: // "AE" yields "AU" (8x more common) - tap_code(KC_U); - return_state = false; // done. - } - break; -#endif // ADAPT_AE_AU -#endif // ADAPT_VOWEL_H - case KC_H: // H precedes a vowel much more often than it follows (thanks, Ancient Greek!) so adaptive H is a sort of Magic Key - switch (prior_keycode) { // maybe OK? What about xxR? resulting in a SFB on thumb? -#ifdef ADAPT_VOWEL_H -#if !defined(ADAPT_AE_AU) && !defined(DE_ADAPTIVES) // AU is really common it German (and influences EN/FR) - case KC_A: // AE is a fraction less common (8x), but the EAE trill may be harder than EAH. - tap_code(KC_U); // "AH" yields "AU" (7x more common) - return_state = false; // done. - break; -#endif // ADAPT_AE_AU or !DE_ADAPTIVES - case KC_U: - tap_code(KC_A); // "UH" yields "UA" (126x more common) - return_state = false; // done. - break; - case KC_E: // these EO/OE adaptives are of questionable value - tap_code(KC_O); // "EH" yields "EO" (1.75:1) - return_state = false; // done. - break; - case KC_O: - tap_code(KC_E); // "OH" yields "OE" (almost 1:1, but eliminates an SFB?) - return_state = false; // done. - break; -#endif // ADAPT_VOWEL_H - 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_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 - case KC_J: // ex. j'habite - case KC_L: // ex. l'hôtel - case KC_N: // ex. n'habite - case KC_D: // ex. d'habitude -#ifdef EN_HDIGRAPH_COMBOS - case KC_T: // t'habitude can't do this (bc Th) unless Th digraph combo is used… -#endif // EN_HDIGRAPH_COMBOS -#endif // FR_ADAPTIVES - tap_code(KC_QUOT); // YH => Y' (pull down to reduce ring-pinky T-B scissor) - break; - case KC_M: // MH->MN eliminate SFB (15x) - tap_code(KC_N); - return_state = false; // done. - break; - case KC_L: // LH->LL eliminate double tap SFB "ll" (355x) - tap_code(KC_L); - return_state = false; // done. - break; - } - break; -#ifdef DE_ADAPTIVES // AU is really common it German (and influences EN/FR) - case KC_I: - switch (prior_keycode) { - case KC_A: // "AI" yields "AU" (8x more common) - tap_code(KC_U); - return_state = false; // done. - break; - } - break; -#endif // DE_ADAPTIVES case KC_F: switch (prior_keycode) { // IF is much more common than IY, so optimizing case KC_Y: // YF = YI (eliminate SFB on ring finger) @@ -426,42 +285,11 @@ bool process_adaptive_key(uint16_t keycode, const keyrecord_t *record) { } break; +#include "adapt_h.c" // the common vowel block adaptives (esp. for AU SFB) -#ifdef THUMB_REPEATER - case HD_REPEATER_A: // Make a repeat key of the secondary thumb key on both sides - case HD_REPEATER_B: // for most common double letters (inherently SFBs) - switch (prior_keycode) { - case KC_A ... KC_SLASH: // should any alpha be repeated? -/* double-letter frequencies from Peter Norvig's data - case KC_L: // 0.577% // Hands Down Platinum – not exactly recommended - case KC_S: // 0.405% - case KC_E: // 0.378% - case KC_O: // 0.210% - case KC_T: // 0.171% // Hands Down Gold - case KC_F: // 0.146% - case KC_P: // 0.137% - case KC_R: // 0.121% // Hands Down Titanium/Rhodium/Vibranium - case KC_M: // 0.096% - case KC_C: // 0.083% - case KC_N: // 0.073% // Hands Down Silver - case KC_D: // 0.043% - case KC_G: // 0.025% - case KC_I: // 0.023% - case KC_B: // 0.011% - case KC_A: // 0.003% - case KC_Z: // 0.003% - case KC_X: // 0.003% - case KC_U: // 0.001% - case KC_H: // 0.001% // Hands Down Bronze -*/ - tap_code(prior_keycode); // eliminate SFB on double - return_state = false; // done. - } - break; -#endif // THUMB_REPEATER -#ifdef ADAPTIVE_TRAILER -#include "adaptive_trailer.c" -#endif // ADAPTIVE_TRAILER +#if defined (HD_MAGIC) || defined (HD_MAGIC_A) || defined (HD_MAGIC_B) +#include "adapt_magic.c" // the common adaptive "magic" key +#endif // } if (return_state) // no adaptive processed, cancel state and pass it on. diff --git a/moutis.h b/moutis.h index e6eda79..5b0e442 100755 --- a/moutis.h +++ b/moutis.h @@ -49,32 +49,46 @@ extern rgblight_config_t rgblight_config; #include "personalizedmacros.h" - -#ifdef THUMB_SHIFT -#include "handsdown/vx-config.ts.h" // definitions for the Alpha layer and mnemonic combos -#include "moutis_layers.ts.h" // definitions for all the other layers -#else -#include "handsdown/pm-config.h" // definitions for the Alpha layer and mnemonic combos -#include "moutis_layers.h" // definitions for all the other layers -#endif - - +// +// which HD alpha variation are we using? +// +// nu = neu (no thumb alpha) +// au = gold (T on thumb) +// mi = mithril (R on thumb) +// pm = promethium (R on thumb) +// rh = rhodium (R on thumb) +// vb = vibranium (R on thumb, b in lower left, f on right) +// vf = vibranium (R on thumb f in lower left, b on right) +// vv = vibranium (R on thumb v in lower left, f on right) +// vx = vibranium (R on thumb x in lower left, f on right) +// +#define HD vb +// +// HD_CONFIG defines all variation dependent constants/files/keycodes, etc. +// that will be used in the respective keymap for each keyboard +// +//#define HD_CONFIG +// +#include "handsdown/vb-config.h" // definitions for the Alpha layer and mnemonic combos +// +// definitions for all the other layers not dependent on the alpha layout. +#include "moutis_layers.h" #define LINGER_TIME TAPPING_TERM * 1.2 // how long to hold before a time-depentant behavior begins // how long to leave a state active before resetting like APPMENU or CAPSWORD #define STATE_RESET_TIME LINGER_TIME * 3 -//#define THUMB_SHIFT // use the thumb shift variant instead of index shift - +// Adaptive (or MAGIC) keys are like a QMK Leader Key, but after (Adaptive Trailer) #define ADAPTIVE_ENABLE - -#define ADAPT_VOWEL_H // eliminate vowel SFBs (AU/UA;EO/OE) using vH instead of v' -#define ADAPT_AE_AU // Use AE->AU (instead of AH->AU) -//#define FR_ADAPTIVES // eliminate 'h SFB for French -//#define DE_ADAPTIVES // alternate AU SFB treatment for German (forces ADAPT_AE_AU) -#define ADAPTIVE_TRAILER KC_HASH // Like QMK Leader Key, but trails, and adaptive #define ADAPT_SHIFT KC_COMM // keycode to precede alpha for one-shot shift (leader) +#define ADAPT_H // eliminate SFBs AU/UA;EO/OE;LN;MN;NN using H (instead of ') +#define ADAPT_AE_AU // Use AE->AU (instead of AH->AU, AH is somewhat common) +//#define FR_ADAPTIVES // eliminate 'h SFB for French +//#define DE_ADAPTIVES // alternate AU SFB treatment for German (same as ADAPT_AE_AU) +#define HD_MAGIC HD_HASH // generic MAGIC_KEY (I use for text macros) +//#define HD_MAGIC_A KC_ENT // MAGIC_KEY dependent on alpha (vowel hand?) +#define HD_MAGIC_B KC_BSPC // MAGIC_KEY dependent on alpha (consonant hand?) #ifdef COMBO_HOLD #undef ADAPTIVE_TERM @@ -84,13 +98,6 @@ extern rgblight_config_t rgblight_config; #endif -//#define THUMB_REPEATER -#ifdef THUMB_REPEATER -#define HD_REPEATER_A HD_BSPC -#define HD_REPEATER_B KC_ENT -#endif - - #ifdef COMBO_ENABLE #include "process_combo.h" #endif @@ -140,7 +147,7 @@ enum OS_Platform { // Used for platform support via SemKeys OS_Mac, // Mac with ANSI_US_EXTENDED layout // OS_iOS, // iOS? OS_Win, // Win with default English/ANSI layout? - OS_Lux, // Linux (Gnome?/KDE?) + OS_Lux, // Linux (Gnome?/KDE?/Boox?) // OS_And, // Android (flavors?) OS_count }; diff --git a/moutis_combo.c b/moutis_combo.c index eac818b..cbbfc87 100644 --- a/moutis_combo.c +++ b/moutis_combo.c @@ -195,22 +195,9 @@ void process_combo_event(uint16_t combo_index, bool pressed) { tap_code16(A(KC_O)); // this should use semkeys break; */ - case HC_NDSH: - register_code16(A(KC_MINS)); // should be a semkey - break; - case HC_MDSH: - register_code16(A(S(KC_MINS))); // should be a semkey - break; - case HC_UNDS: -#ifdef JP_MODE_ENABLE -#ifdef JP_YOUON_COMBOS_ALL - // case jp_byu: // びゅ - if (!IS_ENGLISH_MODE) // in Japanese mode? - send_string("byu"); // Y: so びゅ - else -#endif // JP_YOUON_COMBOS_ALL -#endif // JP_MODE_ENABLE - tap_code16(S(KC_MINS)); // _ underscore (semkey this?) + case HC_NDSH: // delay action until key-up (outside of delay block) +// register_code16(A(KC_MINS)); // should be a semkey + combo_on = combo_index; // hold to replace with m-dash break; #ifdef EN_PRONOUN_COMBOS // the entirely unnecessary pronoun combo shenanigans @@ -554,7 +541,7 @@ void process_combo_event(uint16_t combo_index, bool pressed) { } // end switch (combo_index) if (combo_on) linger_timer = timer_read(); // start timing for linger process // should GUARD this with return instead - } else { // end if (pressed) so this is the key up switch, hold threshold not met. + } else { // end if (pressed) so this is the key up switch, hold threshold NOT met. #ifdef OLED_DRIVER_ENABLE oled_set_cursor(0,combo_OLED_row); oled_write_P(PSTR(" "), false); @@ -605,6 +592,9 @@ void process_combo_event(uint16_t combo_index, bool pressed) { case HC_COLN: tap_code16(KC_COLN); // break; + case HC_NDSH: // Send N-Dash if not held. + tap_code16(A(KC_MINS)); // this should use semkeys + break; case PC_DASH: tap_code(KC_P1); @@ -689,7 +679,6 @@ void process_combo_event(uint16_t combo_index, bool pressed) { break; case HC_EQL: // tap_code16(KC_EQL); // Not held, so… - linger_key = 0; break; } // end switch(combo_index) { @@ -697,13 +686,6 @@ void process_combo_event(uint16_t combo_index, bool pressed) { // 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: - unregister_code16(A(KC_MINS)); // this should use semkeys - break; - case HC_MDSH: - unregister_code16(A(S(KC_MINS))); // this should use semkeys - break; - } // end switch(combo_index) { } // else if (threshold met) combo_on = combo_triggered = false; @@ -784,8 +766,8 @@ void matrix_scan_user_process_combo() { // called from matrix_scan_user if comb case HC_AT: send_string(At_ComboHeld); break; - case HC_COLN: - tap_code16(A(KC_SCLN)); // held, so … (this could use semkeys) + case HC_COLN: // held, so … + tap_code16(A(KC_SCLN)); // (this could use semkeys) break; case HC_OE: case HC_Q: @@ -794,6 +776,9 @@ void matrix_scan_user_process_combo() { // called from matrix_scan_user if comb case HC_EQL: tap_code16(KC_PERC); // Held, so send % (instead of =) break; + case HC_NDSH: // Held, so send M-Dash (instead of N-Dash). + tap_code16(A(S(KC_MINS))); // this should use semkeys + break; case PC_STAB: tap_code16(S(KC_TAB)); diff --git a/moutis_combo.h b/moutis_combo.h index 042a931..5e7441c 100644 --- a/moutis_combo.h +++ b/moutis_combo.h @@ -55,8 +55,7 @@ enum my_combos { HC_EXLM, // ! HC_SCLN, // ; HC_UNDS, // _ underscore - HC_NDSH, // – N-dash - HC_MDSH, // — M-dash + HC_NDSH, // – N-dash (M-dash if held) HC_TILD, // ~ tilde HC_TIC, // ` tic (not a dead key) HC_ACUT, // ´ acute @@ -111,7 +110,7 @@ enum my_combos { PC_TAB, // on num HC_AT, // @ - HC_COLN, // : + HC_COLN, // : (… if held) // Fast entry 4grams // since combos are a bit slower, // needs to be a 4gram+ or more to be worth it @@ -208,7 +207,7 @@ enum my_combos { jp_hyu, // ひゅ jp_hyo, // ひょ jp_bya, // びゃ - jp_byu, // びゅ // potential conflict + jp_byu, // びゅ jp_byo, // びょ jp_mya, // みゃ jp_myu, // みゅ @@ -263,15 +262,16 @@ enum my_combos { FC_KILL, // Force quit FC_SCAP, // Screen Capture Selection FC_SCLP, // Screen Capture Selection to clipboard + FC_SRCH, // Platform search (siri/cortana/–uses semkey) HC_ENT, - HC_ENT2, // hard enter (cmd/ctrl-enter) + HC_ENT2, // hard enter (cmd/ctrl-enter–uses semkey) HC_SPC, HC_NEW, HC_OPEN, HC_CLOZ, HC_QUIT, - HC_FIND, // Find the selection + HC_FIND, // Find the selection (in app/doc) HC_SWRD, // select current word HC_SALL, // select all diff --git a/moutis_combo_def.c b/moutis_combo_def.c index fc0edda..32db7eb 100644 --- a/moutis_combo_def.c +++ b/moutis_combo_def.c @@ -56,8 +56,9 @@ const uint16_t PROGMEM H_Left_combo[] = {HD_LT3, HD_LT2, HD_LT1, COMBO_END}; // const uint16_t PROGMEM H_Right_combo[] = {HD_RT1, HD_RT2, HD_RT3, COMBO_END}; // some demonstrator macro placeholder const uint16_t PROGMEM F_KILL_combo[] = {HD_RT3, HD_RT0, COMBO_END}; // KILL = Force quit OR CTRL-ALT-DEL -const uint16_t PROGMEM F_SCLP_combo[] = {HD_LT2, HD_LT1, HD_LT0, COMBO_END}; // SCREEN shot SELECTION to clipboard 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_SCLP_combo[] = {HD_LT2, HD_LT1, HD_LT0, COMBO_END}; // SCREEN shot SELECTION to clipboard +const uint16_t PROGMEM F_SRCH_combo[] = {HD_LM2, HD_LM1, HD_LM0, COMBO_END}; // platform search (siri/cortana, etc.) const uint16_t PROGMEM H_CAPW_combo[] = {HD_RB3, HD_RB4, COMBO_END}; // CAPS WORD (on until word delimiter) @@ -74,12 +75,10 @@ const uint16_t PROGMEM H_KANA_combo[] = {HD_RM3, HD_RM2, HD_RM1, COMBO_END}; // // Bronze/Silver/Platinum (C on right hand, H on left/thumb) may need changes... // const uint16_t PROGMEM F_ESC_combo[] = {HD_LM4, HD_LM1, COMBO_END}; // ESCape -const uint16_t PROGMEM Hndsh_combo[] = {HD_RB0, HD_RB1, COMBO_END}; // – n dash -const uint16_t PROGMEM Hmdsh_combo[] = {HD_RB0, HD_RB2, COMBO_END}; // — m dash +const uint16_t PROGMEM Hndsh_combo[] = {HD_RB0, HD_RB1, COMBO_END}; // – n dash (hold for m-dash) const uint16_t PROGMEM Htild_combo[] = {HD_RB0, HD_RB3, COMBO_END}; // ~ tilde (not the deadkey for eñye) const uint16_t PROGMEM Hunds_combo[] = {HD_RB1, HD_RB3, COMBO_END}; // _ underscore const uint16_t PROGMEM Hequal_combo[] = {HD_RB2, HD_RB3, COMBO_END}; // = equal (hold for %) -//const uint16_t PROGMEM Hpercent_combo[] = {HD_RB3, HD_RB4, COMBO_END}; // % percent // spatially arranged characters and diacritics @@ -318,7 +317,7 @@ combo_t key_combos[] = { [HC_APPNAV] = COMBO(H_menu_nav_combo, KC_APP), // app menu [HC_SCLN] = COMBO(Hscln_combo, KC_SCLN), // ; [HC_COLN] = COMBO_ACTION(Hcoln_combo), // : (hold for elipsis) - [HC_UNDS] = COMBO_ACTION(Hunds_combo), // _ underscore + [HC_UNDS] = COMBO(Hunds_combo, S(KC_UNDS)), // _ underscore [HC_TILD] = COMBO(Htild_combo, KC_TILD), // ~ or SK_TILD? [HC_TIC] = COMBO(Htic_combo, KC_GRAVE), // ` (not dead) [HC_EXLM] = COMBO(Hexlm_combo, KC_EXLM), // ! @@ -388,7 +387,7 @@ combo_t key_combos[] = { [jp_hyu] = COMBO_ACTION(hyu_combo), // ひゅ [jp_hyo] = COMBO_ACTION(hyo_combo), // ひょ [jp_bya] = COMBO_ACTION(bya_combo), // びゃ - [jp_byu] = COMBO_ACTION(byu_combo), // びゅ potential conflict with diactric combos + [jp_byu] = COMBO_ACTION(byu_combo), // びゅ [jp_byo] = COMBO_ACTION(byo_combo), // びょ [jp_mya] = COMBO_ACTION(mya_combo), // みゃ [jp_myu] = COMBO_ACTION(myu_combo), // みゅ @@ -439,18 +438,18 @@ combo_t key_combos[] = { [PC_AC] = COMBO(PCME_combo, KC_ESC), // ESC for "ALL CLEAR" [PC_PLMN] = COMBO_ACTION(PPLMN_combo), // ± - [FC_ESC] = COMBO(F_ESC_combo, KC_ESC), // ESCape + [FC_ESC] = COMBO(F_ESC_combo, KC_ESC), // ESCape [FC_KILL] = COMBO(F_KILL_combo, SK_KILL), // Force quit [FC_SCAP] = COMBO(F_SCAP_combo, SK_SCAP), // SCREEN CAPTURE SELECTION [FC_SCLP] = COMBO(F_SCLP_combo, SK_SCLP), // SCREEN CAPTURE SELECTION to clipboard + [FC_SRCH] = COMBO(F_SRCH_combo, SK_SRCH), // platform search (siri/cortana, etc.) [FC_CAPS] = COMBO(F_CAPS_combo, KC_CAPS), // CAPS LOCK - [HC_CAPW] = COMBO_ACTION(H_CAPW_combo), // CAPS_WORD + [HC_CAPW] = COMBO_ACTION(H_CAPW_combo), // CAPS_WORD [FC_LANG2] = COMBO(H_EISUU_combo, SK_MHEN), // eisuu (others) [FC_LANG1] = COMBO(H_KANA_combo, SK_HENK), // kana (others) - [HC_NDSH] = COMBO_ACTION(Hndsh_combo), // – N-DASH - [HC_MDSH] = COMBO_ACTION(Hmdsh_combo), // — M-DASH + [HC_NDSH] = COMBO_ACTION(Hndsh_combo), // – N-DASH (hold for M-dash) // Dead keys (Mac only, for now) [HC_ACUT] = COMBO_ACTION(Hacut_combo), // ´ acute @@ -534,10 +533,10 @@ combo_t key_combos[] = { [HC_here_4gram] = COMBO_ACTION(H_here_combo), // TYPE "here" #9 #endif -#ifdef HD_Left_keys +#ifdef LeftComboTapE [HC_TYPE_LEFTCOMBO] = COMBO_ACTION(H_Left_combo), // a personally useful 5-8gram! #endif -#ifdef HD_Right_keys +#ifdef RightComboTapE [HC_TYPE_RIGHTCOMBO] = COMBO_ACTION(H_Right_combo), // a demonstrator, how long autotypes can be! #endif @@ -565,7 +564,7 @@ combo_t key_combos[] = { [HC_QUIT] = COMBO(Hquit_combo, SK_QUIT), #endif #ifdef HD_find_keys - [HC_FIND] = COMBO_ACTION(Hfind_combo), + [HC_FIND] = COMBO_ACTION(Hfind_combo), // application find (in app/doc) #endif #ifdef HD_sall_keys [HC_SALL] = COMBO(Hsall_combo, SK_SALL), diff --git a/moutis_layers.h b/moutis_layers.h index a0167d8..3fb74ce 100644 --- a/moutis_layers.h +++ b/moutis_layers.h @@ -160,20 +160,21 @@ __ │ · ] ) } ° │ __ __ __ __ │ /* L_NUM Navigation (left) NUMPad Layer (right) (LN) - ╭──────────────────────────────────────────╮ ╭──────────────────────────────────────────╮ -__ │ NUM_LK PGUP UP PGDN TAB │ │ PSLS P7 P8 P9 PMNS │ __ -__ │ W_LEFT LEFT DOWN RGHT W_RGHT | | PAST P4 P5 P6 PPLS │ __ -__ │ UNDO CUT COPY PSTE SPC │ __ __ __ __ │ PCMM P1 P2 P3 PEQL │ __ - ╰────────────────╮ __ G_T(BSP) C_T(ENT)│ __ __ │ P0 PDOT __ ╭────────────────╯ - __ __ ╰─────────────────────────╯ ╰─────────────────────────╯ __ __ + // Nav & NumPad (standard) + //╭─────────────────────────────────────────────╮ ╭────────────────────────────────────────╮ + //| Top | HOME | UP | PG_UP | ¶up | | / | 7 | 8 | 9 | - | + //| Lword | LEFT | DOWN | RGT | Rword | | * | S/4 | G/5 | A/6 | C/+ | + //| Bot | END | SPC | PG_DN | ¶dn | | , | 1 | 2 | 3 | = | + //╰─────────────────╮ tog | BSPC |KP_ENTER | | 0 | . | tog ╭───────────────╯ + // ╰───────────────────────────╯ ╰────────────────────────╯ */ #define LN_LT5 KC_TRNS -#define LN_LT4 KC_NUM -#define LN_LT3 KC_PGDN +#define LN_LT4 SK_DOCBEG +#define LN_LT3 KC_HOME #define LN_LT2 KC_UP #define LN_LT1 KC_PGUP -#define LN_LT0 KC_TAB +#define LN_LT0 SK_PARAPRV #define LN_RT0 KC_PSLS #define LN_RT1 KC_P7 #define LN_RT2 KC_P8 @@ -195,11 +196,11 @@ __ │ UNDO CUT COPY PSTE SPC │ __ __ __ __ │ PCMM #define LN_RM5 KC_TRNS #define LN_LB5 KC_TRNS -#define LN_LB4 SK_UNDO -#define LN_LB3 SK_CUT -#define LN_LB2 SK_COPY -#define LN_LB1 SK_PSTE -#define LN_LB0 KC_SPC +#define LN_LB4 SK_DOCEND +#define LN_LB3 KC_END +#define LN_LB2 KC_SPC +#define LN_LB1 KC_PGDN +#define LN_LB0 SK_PARANXT #define LN_LBA KC_ESC #define LN_LBB KC_TRNS #define LN_RBB KC_TRNS @@ -213,16 +214,16 @@ __ │ UNDO CUT COPY PSTE SPC │ __ __ __ __ │ PCMM #define LN_LH5 KC_VOLD // also left encoder CCW #define LN_LH4 KC_VOLU // also left encoder CW -#define LN_LH3 KC_TRNS +#define LN_LH3 TG(L_NAV) #define LN_LH2 LGUI_T(KC_BSPC) #define LN_LH1 LSFT_T(KC_ENT) #define LN_LH0 SK_CLOZ // also left encoder key switch #define LN_LHA KC_NO -#define LN_RHA TG(L_NAV) +#define LN_RHA KC_NO #define LN_RH0 KC_C // also right encoder key switch #define LN_RH1 KC_P0 #define LN_RH2 KC_PDOT -#define LN_RH3 KC_TRNS +#define LN_RH3 TG(L_NUM) #define LN_RH4 SK_HISTPRV // also left encoder CCW #define LN_RH5 SK_HISTNXT // also right encoder CW @@ -290,7 +291,7 @@ __ │ UNDO CUT COPY PSTE FAGN │ ESC TAB __ __ │ DOCEND #define LV_RH0 SK_ZOOMRST // also right encoder key switch #define LV_RH1 SK_HISTPRV #define LV_RH2 SK_HISTNXT -#define LV_RH3 TG(L_NAV) +#define LV_RH3 TG(L_NUM) #define LV_RH4 SK_PARAPRV // also right encoder CCW #define LV_RH5 SK_PARANXT // also right encoder CW diff --git a/moutis_process_record.c b/moutis_process_record.c index 6005f11..cee36e4 100755 --- a/moutis_process_record.c +++ b/moutis_process_record.c @@ -29,7 +29,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if ( (prior_keycode == ADAPT_SHIFT) && // is it shift leader? !caps_word_timer && // not already doing a caps_word? - (timer_elapsed(prior_keydown) <= ADAPTIVE_TERM * 32) && // use huge threshold? + (timer_elapsed(prior_keydown) <= ADAPTIVE_TERM * 4) && // use large threshold? ((keycode & QK_BASIC_MAX) >= KC_A) && // followed by any alpha? ((keycode & QK_BASIC_MAX) <= KC_Z)) { tap_code(KC_BSPC); // get rid of ADAPT_SHIFT diff --git a/moutis_semantickeys.c b/moutis_semantickeys.c index c0b8159..bb0db0f 100644 --- a/moutis_semantickeys.c +++ b/moutis_semantickeys.c @@ -82,7 +82,8 @@ const uint16_t SemKeys_t[SemKeys_COUNT - SK_KILL][OS_count] = { [SK_FIND - SK_KILL] = {G(KC_F),C(KC_F),C(KC_F)}, // find [SK_FAGN - SK_KILL] = {G(KC_G),KC_F3,KC_F3}, // find again [SK_SCAP - SK_KILL] = {S(G(KC_4)),KC_PSCR,KC_PSCR}, // Screen Capture - [SK_SCLP - SK_KILL] = {C(S(G(KC_4))),A(KC_PSCR),A(KC_PSCR)}, // Selection Capture)) + [SK_SCLP - SK_KILL] = {C(S(G(KC_4))),A(KC_PSCR),A(KC_PSCR)}, // Selection Capture + [SK_SRCH - SK_KILL] = {G(KC_SPC),G(KC_S),G(KC_SPC)}, // platform search (siri/cortana, etc.) // [SK_DEL - SK_KILL] = {KC_DEL,KC_DEL,KC_DEL}, // DELETE CHAR RIGHT [SK_DELWDL - SK_KILL] = {A(KC_BSPC),C(KC_BSPC),C(KC_BSPC)}, // DELETE WORD LEFT [SK_DELWDR - SK_KILL] = {A(KC_DEL),C(KC_DEL),C(KC_DEL)}, // DELETE WORD RIGHT diff --git a/moutis_semantickeys.h b/moutis_semantickeys.h index 7688637..8e3daea 100644 --- a/moutis_semantickeys.h +++ b/moutis_semantickeys.h @@ -59,6 +59,7 @@ enum my_keycodes { SK_FAGN, // find again SK_SCAP, // screen capture to clipboard SK_SCLP, // selection capture to clipboard + SK_SRCH, // platform search (siri/cortana, etc.) // SK_DEL, // Delete char right of cursor SK_DELWDL, // Delete word left of cursor SK_DELWDR, // Delete word right of cursor diff --git a/personalizedmacros.h b/personalizedmacros.h deleted file mode 100755 index cb4d0ec..0000000 --- a/personalizedmacros.h +++ /dev/null @@ -1,33 +0,0 @@ -// -// personalizedmacros.h -// -// - -#define At_ComboHeld "alanreiser.com" - -#define LeftComboTapE "English " -#define LeftComboHeldE "End of times in 2020" -#define LeftComboTapJ "arigatou" -#define LeftComboHeldJ "yorosiku" -#define RightComboTapE "Japan " -#define RightComboHeldE "Japanese " -#define RightComboTapJ "gozaimasu." -#define RightComboHeldJ "onegaisimasu." - -#define adaptAHASH "Amanda" -#define adaptBHASH "Bug" -#define adaptDHASH "Dear " -#define adaptIHASH "Indiana " -#define adaptGHASH "Gratefully, " -#define adaptEHASH "Eric" -#define adaptJHASH "Jacob" -#define adaptLHASH "Lauren" -#define adaptMHASH "mym0vies" -#define adaptPHASH "Bloomington" -#define adaptRHASH "Reiser" -#define adaptSHASH "Sincerely, " -#define adaptTHASH "Tahlia" -#define adaptUHASH "University " -#define adaptVHASH "Vivian" -#define adaptXHASH "pianobylauren@gmail.com" -#define adaptZHASH "Zoe" diff --git a/rules.mk b/rules.mk index 9888a06..b58aad7 100644 --- a/rules.mk +++ b/rules.mk @@ -14,9 +14,9 @@ TAP_DANCE_ENABLE = no AUTO_SHIFT_ENABLE = no # requires 1936 bytes! -EXTRAKEY_ENABLE = yes # Audio control and System control -COMBO_ENABLE = yes # chording -LTO_ENABLE = yes +EXTRAKEY_ENABLE = yes # Audio control and System control +COMBO_ENABLE = yes # chording +LTO_ENABLE = yes # optimize at link time EXTRAFLAGS += -flto SRC += moutis.c