From eaf7be047aa6b63159968cef8f6d6f378f70ba0f Mon Sep 17 00:00:00 2001 From: moutis <35399827+moutis@users.noreply.github.com> Date: Wed, 15 Nov 2023 16:25:18 -0500 Subject: [PATCH] Semantic Keys updated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Most Symbols are now handled via semantic keys. paired « ‹ › » enabled via semantic keys. Tidied up process record a bit. Tweaked adaptive for vb (and other variations) --- handsdown/au-config.h | 42 +++++++++---------- handsdown/mi-config.h | 42 +++++++++---------- handsdown/nu-config.h | 42 +++++++++---------- handsdown/vb-adaptive.c | 14 +++++-- handsdown/vb-config.h | 61 +++++++++++++-------------- handsdown/vv-adaptive.c | 2 +- handsdown/vv-config.h | 48 ++++++++++----------- moutis.h | 25 ++++++----- moutis_ENCODER.c | 4 +- moutis_combo_def.c | 9 ++-- moutis_layers.h | 50 ++++++++++++---------- moutis_matrix.c | 22 +++++++--- moutis_process_record.c | 36 ++++++++-------- moutis_semantickeys.c | 93 +++++++++++------------------------------ moutis_semantickeys.h | 45 +++++++++++++------- 15 files changed, 267 insertions(+), 268 deletions(-) diff --git a/handsdown/au-config.h b/handsdown/au-config.h index 3b684da..4e3537f 100644 --- a/handsdown/au-config.h +++ b/handsdown/au-config.h @@ -151,8 +151,26 @@ // These few spatial combos may move to accommodate some mnemonic combos, // notably the H-digraph combos that inhabit close areas. // -#define HD_tab_keys HD_LM4, HD_LM3 // tab -#define HD_stab_keys HD_LM4, HD_LM3, HD_LM1 // shift-tab +// SEMANTIC FUNCTIONS ** uses SemKeys ** +// Spatially arranged on the QWERTY ZXCV locations +// independent of the HD Alphas, though since some of +// 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_find_keys HD_RM4, HD_RB0 // find selection +#define HD_sall_keys HD_LB4, HD_LB1 // select all +#define HD_swrd_keys HD_LB4, HD_LB0 // select word +#define HD_undo_keys HD_LB4, HD_LB3 // undo +#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo +#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 @@ -161,7 +179,7 @@ // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // #define HD_Qu_keys HD_LT3, HD_LT1 // TYPE "q" (Qu & Linger deletes u) -#define HD_L1_keys HD_LT1, HD_LT0 // ex. TYPE "z" +#define HD_L1_keys HD_LM3, HD_LM1 // ex. TYPE "z" #define HD_L1 HD_Z //#define HD_L2_keys HD_LM3, HD_LM1 // ex. TYPE "x" //#define HD_L2 HD_X @@ -224,24 +242,6 @@ #endif // EN_PRONOUNS_ALL #endif // EN_PRONOUNS // the entirely unnecessary pronoun combo shenanigans -// SEMANTIC FUNCTIONS ** uses SemKeys ** -// Spatially arranged on the QWERTY ZXCV locations -// independent of the HD Alphas, though since some of -// 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_find_keys HD_RM4, HD_RB0 // find selection -#define HD_sall_keys HD_LB4, HD_LB1 // select all -#define HD_swrd_keys HD_LB4, HD_LB0 // select word -#define HD_undo_keys HD_LB4, HD_LB3 // undo -#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo -#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) - #ifdef JP_MODE_ENABLE #ifdef JP_YOUON_COMBOS // Major Japanese contracted consonants as combos diff --git a/handsdown/mi-config.h b/handsdown/mi-config.h index 174d29e..4723b2e 100644 --- a/handsdown/mi-config.h +++ b/handsdown/mi-config.h @@ -151,8 +151,26 @@ // These few spatial combos may move to accommodate some mnemonic combos, // notably the H-digraph combos that inhabit close areas. // -#define HD_tab_keys HD_LM3, HD_LM1 // tab -#define HD_stab_keys HD_LM3, HD_LM2, HD_LM1 // hard-ENTER/page break +// SEMANTIC FUNCTIONS ** uses SemKeys ** +// Spatially arranged on the QWERTY ZXCV locations +// independent of the HD Alphas, though since some of +// 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_find_keys HD_RM4, HD_RB0 // find selection +#define HD_sall_keys HD_LB4, HD_LB1 // select all +#define HD_swrd_keys HD_LB4, HD_LB0 // select word +#define HD_undo_keys HD_LB4, HD_LB3 // undo +#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo +#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 @@ -161,7 +179,7 @@ // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // #define HD_Qu_keys HD_LT3, HD_LT1 // TYPE "q" (Qu & Linger deletes u) -#define HD_L1_keys HD_LT1, HD_LT0 // ex. TYPE "z" +#define HD_L1_keys HD_LM3, HD_LM1 // ex. TYPE "z" #define HD_L1 HD_X //#define HD_L2_keys HD_LM3, HD_LM1 // ex. TYPE "x" //#define HD_L2 HD_X @@ -224,24 +242,6 @@ #endif // EN_PRONOUNS_ALL #endif // EN_PRONOUNS // the entirely unnecessary pronoun combo shenanigans -// SEMANTIC FUNCTIONS ** uses SemKeys ** -// Spatially arranged on the QWERTY ZXCV locations -// independent of the HD Alphas, though since some of -// 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_find_keys HD_RM4, HD_RB0 // find selection -#define HD_sall_keys HD_LB4, HD_LB1 // select all -#define HD_swrd_keys HD_LB4, HD_LB0 // select word -#define HD_undo_keys HD_LB4, HD_LB3 // undo -#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo -#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) - #ifdef JP_MODE_ENABLE #ifdef JP_YOUON_COMBOS // Major Japanese contracted consonants as combos diff --git a/handsdown/nu-config.h b/handsdown/nu-config.h index d814784..83b7090 100644 --- a/handsdown/nu-config.h +++ b/handsdown/nu-config.h @@ -151,8 +151,26 @@ // These few spatial combos may move to accommodate some mnemonic combos, // notably the H-digraph combos that inhabit close areas. // -#define HD_tab_keys HD_LM3, HD_LM1 // tab -#define HD_stab_keys HD_LM3, HD_LM2, HD_LM1 // hard-ENTER/page break +// SEMANTIC FUNCTIONS ** uses SemKeys ** +// Spatially arranged on the QWERTY ZXCV locations +// independent of the HD Alphas, though since some of +// 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_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 +#define HD_undo_keys HD_LB4, HD_LB3 // undo +#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo +#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_LH2, HD_LH1 // ENTER #define HD_ent2_keys HD_LB0, HD_LB1, HD_LB2 // hard-ENTER/page break @@ -161,7 +179,7 @@ // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // #define HD_Qu_keys HD_LT3, HD_LT1 // TYPE "q" (Qu & Linger deletes u) -#define HD_L1_keys HD_LT1, HD_LT0 // ex. TYPE "z" +#define HD_L1_keys HD_LM3, HD_LM1 // ex. TYPE "z" #define HD_L1 HD_Z //#define HD_L2_keys HD_LM3, HD_LM1 // ex. TYPE "x" //#define HD_L2 HD_X @@ -224,24 +242,6 @@ #endif // EN_PRONOUN_keysS_ALL #endif // EN_PRONOUN_keysS // the entirely unnecessary pronoun combo shenanigans -// SEMANTIC FUNCTIONS ** uses SemKeys ** -// Spatially arranged on the QWERTY ZXCV locations -// independent of the HD Alphas, though since some of -// 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_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 -#define HD_undo_keys HD_LB4, HD_LB3 // undo -#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo -#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) - #ifdef JP_MODE_ENABLE #ifdef JP_YOUON_COMBOS // Major Japanese contracted consonants as combos diff --git a/handsdown/vb-adaptive.c b/handsdown/vb-adaptive.c index 4da4366..9327712 100644 --- a/handsdown/vb-adaptive.c +++ b/handsdown/vb-adaptive.c @@ -51,6 +51,8 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) case KC_B: switch (prior_keycode) { case KC_P: // avoid row step (PS is 40x more common than PB) + tap_code(KC_S); + return_state = false; // done. case KC_C: // eliminate SB SFB (CB is 11x more common than SB) tap_code(KC_BSPC); tap_code(KC_S); @@ -59,7 +61,9 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) break; case KC_M: // M becomes L (pull up "L" to same row) switch (prior_keycode) { - case KC_B: // tricksy - trilling "mxm" results in "mbl" trigram instead of scissor +// case KC_B: // tricksy - trilling "mxm" results in "mbl" trigram instead of scissor + // but this makes norman BM = BL...so not great. proper adaptive method is needed + // that recognizes N-gram sequences. Maybe at the migrate to RP2040 or the like? case KC_P: // tricksy - trilling "mwm" results in "mpl" trigram instead of scissor // rolling "xwm" is also captured here, resulting in "xpl" case KC_G: // pull up "L" (GL is 5x more common than GM) @@ -94,11 +98,13 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) break; case KC_W: switch (prior_keycode) { - case KC_L: // tricksy - trilling "wmw" results in "lml" trigram instead of SFB + case KC_B: // tricksy - trilling "mxw" results in "mbl" trigram scissoring + case KC_L: // tricksy - trilling "wmw" results in "lml" trigram instead of2 SFB goto PullUpLAndExit; // short jumps save bytes 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 abter M to set up "mp"+l) *calling_keycode = KC_P; // tricksy - pretend the last was P, for "mpl" or "xpl" trigram + case KC_J: // tap_code(KC_P); // pull up P from bottom row. return_state = false; // done. break; @@ -114,6 +120,9 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) goto PullUpLAndExit; // short jumps save bytes case KC_M: goto ReplacePriorWithL; + case KC_J: + tap_code(KC_P); // yields jpg + break; case KC_W: tap_code(KC_BSPC); send_string("lml"); // for "calmly" but not quite intuitive… @@ -175,7 +184,6 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) tap_code(KC_G); return_state = false; // done. break; - case KC_V: // Pull S down from middle row. 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...) diff --git a/handsdown/vb-config.h b/handsdown/vb-config.h index 25f03ee..72a4a4f 100644 --- a/handsdown/vb-config.h +++ b/handsdown/vb-config.h @@ -77,8 +77,8 @@ #define HD_LT2 HD_M #define HD_LT1 HD_G #define HD_LT0 HD_J -#define HD_LTA OSL(L_CFG) -#define HD_RTA TG(L_NUM) +#define HD_LTA LT(L_CFG, KC_MUTE) +#define HD_RTA LT(L_CFG, KC_MPLY) #define HD_RT0 HD_HASH #define HD_RT1 HD_DOT #define HD_RT2 HD_SLSH @@ -108,9 +108,9 @@ #define HD_LB1 HD_D #define HD_LB0 HD_V #define HD_LBA LT(L_NUM, KC_LBRC) -#define HD_LBB LT(L_FUN,SK_COPY) -#define HD_RBB LT(L_FUN,SK_PSTE) -#define HD_RBA LT(L_NAV,KC_RBRC) +#define HD_LBB LT(L_CFG, KC_LNG2) +#define HD_RBB LT(L_FUN, KC_LNG1) +#define HD_RBA LT(L_NAV, KC_RBRC) #define HD_RB0 HD_MINS #define HD_RB1 HD_U #define HD_RB2 HD_O @@ -120,7 +120,7 @@ //Primary Thumbs 1-3 (others are unique to the board) #define HD_LH5 KC_LEFT -#define HD_LH4 LT(L_FUN,KC_MUTE) +#define HD_LH4 KC_RGHT #define HD_LH3 KC_APP #define HD_LH2 HD_BSPC #define HD_LH1 HD_R @@ -131,8 +131,8 @@ #define HD_RH1 HD_SPC #define HD_RH2 HD_ENT #define HD_RH3 TG(L_NUM) -#define HD_RH4 LT(L_FUN,KC_MPLY) -#define HD_RH5 KC_DN +#define HD_RH4 KC_UP +#define HD_RH5 KC_DOWN #ifdef COMBO_ENABLE // @@ -151,17 +151,36 @@ // These few spatial combos may move to accommodate some mnemonic combos, // notably the H-digraph combos that inhabit close areas. // -#define HD_tab_keys HD_LM3, HD_LM1 // tab -#define HD_stab_keys HD_LM3, HD_LM2, HD_LM1 // hard-ENTER/page break +// SEMANTIC FUNCTIONS ** uses SemKeys ** +// Spatially arranged on the QWERTY ZXCV locations +// independent of the HD Alphas, though since some of +// 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_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 +#define HD_undo_keys HD_LB4, HD_LB3 // undo +#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo +#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 // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // #define HD_Qu_keys HD_LT3, HD_LT1 // TYPE "q" (Qu & Linger deletes u) -#define HD_L1_keys HD_LT4, HD_LT3 // ex. TYPE "z" +#define HD_L1_keys HD_LM3, HD_LM1 // ex. TYPE "z" #define HD_L1 HD_Z //#define HD_L2_keys HD_LM3, HD_LM1 // ex. TYPE "x" //#define HD_L2 HD_X @@ -227,26 +246,6 @@ -// SEMANTIC FUNCTIONS ** uses SemKeys ** -// Spatially arranged on the QWERTY ZXCV locations -// independent of the HD Alphas, though since some of -// 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_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 -#define HD_undo_keys HD_LB4, HD_LB3 // undo -#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo -#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) - - - #ifdef JP_MODE_ENABLE #ifdef JP_YOUON_COMBOS // Major Japanese contracted consonants as combos diff --git a/handsdown/vv-adaptive.c b/handsdown/vv-adaptive.c index 882af19..a0f665b 100644 --- a/handsdown/vv-adaptive.c +++ b/handsdown/vv-adaptive.c @@ -45,7 +45,7 @@ bool process_adaptive_key(uint16_t *calling_keycode, const keyrecord_t *record) return_state = false; // done. break; case KC_J: - tap_code(KC_P); + tap_code(KC_P); // yields jpg break; case KC_K: goto PullUpLAndExit; // short jumps save bytes diff --git a/handsdown/vv-config.h b/handsdown/vv-config.h index 4edcfd4..840c9c1 100644 --- a/handsdown/vv-config.h +++ b/handsdown/vv-config.h @@ -108,9 +108,9 @@ #define HD_LB1 HD_D #define HD_LB0 HD_SLSH #define HD_LBA LT(L_NUM, KC_LBRC) -#define HD_LBB LT(L_FUN,SK_COPY) -#define HD_RBB LT(L_FUN,SK_PSTE) -#define HD_RBA LT(L_NAV,KC_RBRC) +#define HD_LBB LT(L_CFG, KC_LNG2) +#define HD_RBB LT(L_FUN, KC_LNG1) +#define HD_RBA LT(L_NAV, KC_RBRC) #define HD_RB0 HD_MINS #define HD_RB1 HD_U #define HD_RB2 HD_O @@ -151,8 +151,26 @@ // These few spatial combos may move to accommodate some mnemonic combos, // notably the H-digraph combos that inhabit close areas. // -#define HD_tab_keys HD_LM3, HD_LM1 // tab -#define HD_stab_keys HD_LM3, HD_LM2, HD_LM1 // hard-ENTER/page break +// SEMANTIC FUNCTIONS ** uses SemKeys ** +// Spatially arranged on the QWERTY ZXCV locations +// independent of the HD Alphas, though since some of +// 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_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 +#define HD_undo_keys HD_LB4, HD_LB3 // undo +#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo +#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 @@ -161,7 +179,7 @@ // TEXT ENTRY - off map standard alphas (also on Layer L_SYM @ Z=LT4 & Q=LT3) // #define HD_Qu_keys HD_LT3, HD_LT1 // TYPE "q" (Qu & Linger deletes u) -#define HD_L1_keys HD_LT1, HD_LT0 // ex. TYPE "z" +#define HD_L1_keys HD_LM3, HD_LM1 // ex. TYPE "z" #define HD_L1 HD_Z //#define HD_L2_keys HD_LM3, HD_LM1 // ex. TYPE "x" //#define HD_L2 HD_X @@ -224,24 +242,6 @@ #endif // EN_PRONOUNS_ALL #endif // EN_PRONOUNS // the entirely unnecessary pronoun combo shenanigans -// SEMANTIC FUNCTIONS ** uses SemKeys ** -// Spatially arranged on the QWERTY ZXCV locations -// independent of the HD Alphas, though since some of -// 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_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 -#define HD_undo_keys HD_LB4, HD_LB3 // undo -#define HD_redo_keys HD_LB4, HD_LB3, HD_LB2 // redo -#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) - #ifdef JP_MODE_ENABLE #ifdef JP_YOUON_COMBOS // Major Japanese contracted consonants as combos diff --git a/moutis.h b/moutis.h index 1962d91..d8c2f40 100644 --- a/moutis.h +++ b/moutis.h @@ -62,7 +62,7 @@ extern rgblight_config_t rgblight_config; #include "moutis_combo.h" // // -// These COULD be made variation dependent, to allow +// These COULD be made variation/platform dependent, to allow // them to adapt to geometry differences. Ex. // most NEU variations have " ' on ring/pinky // but Bronze/Silver heve ' " (inverted) @@ -71,14 +71,10 @@ extern rgblight_config_t rgblight_config; // Perhaps simply redefining these in the xx-config.h // to override these defs would be the right approach? // -#define DQUO_S KC_RBRC // ] Double quote shifted -#define DQUO_A A(S(KC_BSLS)) // » Double quote alted -#define DQUO_SA A(S(KC_4)) // › Double quote shifted & alted -#define SQUO_S KC_LBRC // [ Single quote shifted -#define SQUO_A A(KC_BSLS) // « single quote alted -#define SQUO_SA A(S(KC_3)) // ‹ single quote shifted & alted -#define JRQU KC_RBRC // keycode for "[" in Japanese mode -#define JLQU KC_LBRC // keycode for "]" in Japanese mode +#define DQUO_S KC_RBRC // ] (via Double quote shifted) +#define SQUO_S KC_LBRC // [ (via Single quote shifted) +#define JRQU KC_RBRC // 「 (via " in Japanese mode) +#define JLQU KC_LBRC // 」 (via ' in Japanese mode) typedef union { @@ -102,15 +98,18 @@ enum my_layers {// must be difined before semantickeys.h }; enum OS_Platform { // Used for platform support via SemKeys - OS_Mac, // uses ANSI_US_EXTENDED layout - OS_Win, + 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_And, // Android (flavors?) OS_count }; #include "moutis_semantickeys.h" -#define register_linger_key(kc) {register_code16(kc);linger_key = kc;linger_timer = state_reset_timer = timer_read();} -#define unregister_linger_key() {unregister_code16(linger_key);linger_key = 0;} +#define register_linger_key(kc) {((kc > (uint16_t)SK_KILL) && (kc < (uint16_t)SemKeys_COUNT)) ? register_SemKey(kc) : register_code16(kc);linger_key = kc;linger_timer = state_reset_timer = timer_read();} +#define unregister_linger_key() {((linger_key > (uint16_t)SK_KILL) && (linger_key < (uint16_t)SemKeys_COUNT)) ? unregister_SemKey(linger_key) : unregister_code16(linger_key);linger_key = 0;} void matrix_scan_user_process_combo(void); diff --git a/moutis_ENCODER.c b/moutis_ENCODER.c index 3f04af9..c01890e 100644 --- a/moutis_ENCODER.c +++ b/moutis_ENCODER.c @@ -53,13 +53,15 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } goto exit; +#ifdef L_NUM_SCAN case L_NUM: // numpad layer (for navigating in spreadsheets) - if (clockwise) { + if (clockwise) { tap_code16(KC_RGHT); // } else { tap_code16(KC_LEFT); // } break; +#endif case L_NAV: // nav layer if (clockwise) { tap_SemKey(SK_ZOOMIN); // ZOOM IN diff --git a/moutis_combo_def.c b/moutis_combo_def.c index e6bdd70..ecfcac3 100644 --- a/moutis_combo_def.c +++ b/moutis_combo_def.c @@ -20,10 +20,11 @@ const uint16_t PROGMEM HC_cfg_combo[] = {HD_RH1, HD_RH2, COMBO_END}; // keyboard settings/config layer #ifdef APPMENU_keys const uint16_t PROGMEM H_menu_combo[] = {APPMENU_keys, COMBO_END}; // AppMENU +const uint16_t PROGMEM H_menu_nav_combo[] = {APPMENU_nav_keys, COMBO_END}; // AppMENU #else const uint16_t PROGMEM H_menu_combo[] = {HD_LB3, HD_LB1, COMBO_END}; // AppMENU // default Appmenu location -#endif const uint16_t PROGMEM H_menu_nav_combo[] = {LN_LB3, LN_LB1, COMBO_END}; // AppMENU on Nav layer +#endif // Spatially arranged on the QWERTY ZXCV locations // @@ -35,7 +36,7 @@ const uint16_t PROGMEM Hent2_combo[] = {HD_ent2_keys, COMBO_END}; // hard-ENTER // SEMANTIC FUNCTIONS ** usinp SemKeys ** const uint16_t PROGMEM Hnew_combo[] = {HD_new_keys, COMBO_END}; // new -const uint16_t PROGMEM Hopen_combo[] = {HD_open_keys, COMBO_END}; // openi +const uint16_t PROGMEM Hopen_combo[] = {HD_open_keys, COMBO_END}; // open const uint16_t PROGMEM Hclose_combo[] = {HD_close_keys, COMBO_END}; // close const uint16_t PROGMEM Hquit_combo[] = {HD_quit_keys, COMBO_END}; // quit const uint16_t PROGMEM Hfind_combo[] = {HD_find_keys, COMBO_END}; // find selection @@ -60,8 +61,8 @@ const uint16_t PROGMEM F_SCAP_combo[] = {HD_LT3, HD_LT2, HD_LT1, HD_LT0, COMBO_E const uint16_t PROGMEM F_CAPS_combo[] = {HD_LM3, HD_LM2, HD_RM2, HD_RM3, COMBO_END}; // CAPS LOCK (on until hit again) const uint16_t PROGMEM H_CAPW_combo[] = {HD_LM1, HD_LM2, HD_RM1, HD_RM2, COMBO_END}; // CAPS WORD (on until word delimiter) -const uint16_t PROGMEM H_EISUU_combo[] = {HD_LB3, HD_LB2, HD_LB1, COMBO_END}; // KC_MHEN -const uint16_t PROGMEM H_KANA_combo[] = {HD_RB3, HD_RB2, HD_RB1, COMBO_END}; // KC_HENK +const uint16_t PROGMEM H_EISUU_combo[] = {HD_LM3, HD_LM2, HD_LM1, COMBO_END}; // KC_MHEN +const uint16_t PROGMEM H_KANA_combo[] = {HD_RM3, HD_RM2, HD_RM1, COMBO_END}; // KC_HENK diff --git a/moutis_layers.h b/moutis_layers.h index 3594eff..b69043f 100644 --- a/moutis_layers.h +++ b/moutis_layers.h @@ -21,33 +21,33 @@ -/* L_SYM Symbols and punctuation - ╭──────────────────────────────────────────╮ ╭───────────────────────────────────────────────╮ -__ │ QUIT CLOZ SCAP SCLP FAGN │ │ DOCBEG HOME UP PGUP PARAPRV │ __ -__ │ LCTL LALT LGUI LSFT FIND | | WORDPRV LEFT DOWN RGHT WORDNXT │ __ -__ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND END DOWN PGDN PARANXT │ __ - ╰──────────────────╮ __ S(MENU) MENU │ __ __ │ HISTPRV HISTNXT __ ╭──────────────────╯ +/* L_SYM Symbols and punctuation (Some via SemKeys/unicode for platform independance) + ╭──────────────────────────────────────────╮ ╭──────────────────────────────────────────╮ +__ │ Z Q § ¶ ‡ │ │ ¢ $ € £ ¥ │ __ +__ │ < [ ( { † | | ¡ * = + / │ __ +__ │ > ] ) } • │ TAB __ __ ESC │ _ | & ^ % │ __ + ╰──────────────────╮ __ D_WordL D_WordR │ __ __ │ HISTPRV HISTNXT __ ╭─────────────╯ HISTPRV HISTNXT ╰───────────────────────╯ ╰────────────────────────────╯ ZOOMRST ZOOMOUT */ /* L_SYM Symbols & punctuation (Much of this should be handled by SemKeys/unicode for platform independance - ______, KC_Z, KC_Q, RALT(KC_5), LALT(KC_7), LSA(KC_7), LALT(KC_4), KC_DLR, A(S(KC_2)), RALT(KC_3), LALT(KC_Y), ______, - ______, KC_LT, KC_LBRC, KC_LPRN, KC_LCBR, RSA(KC_5), RALT(KC_1), RSFT_T(KC_PAST), RGUI_T(KC_PEQL), RALT_T(KC_PPLS), RCTL_T(KC_PSLS), ______, - ______, KC_GT, KC_RBRC, KC_RPRN, KC_RCBR, LALT(KC_8), ______, ______, ______, ______, KC_UNDS, KC_PIPE, KC_AMPR, KC_CIRC, KC_PERC, ______, + ______, KC_Z, KC_Q, SK_SECT, SK_PARA, SK_DCRS, SK_CENT, KC_DLR, SK_EURO, SK_BPND, SK_JPY, ______, + ______, KC_LT, KC_LBRC, KC_LPRN, KC_LCBR, SK_SCRS, SK_IEXC, RSFT_T(KC_PAST), RGUI_T(KC_PEQL), RALT_T(KC_PPLS), RCTL_T(KC_PSLS), ______, + ______, KC_GT, KC_RBRC, KC_RPRN, KC_RCBR, SK_BBLT, ______, ______, ______, ______, KC_UNDS, KC_PIPE, KC_AMPR, KC_CIRC, KC_PERC, ______, ______, KC_VOLD, SK_DELWDL, SK_DELWDR, KC_VOLU, LALT(KC_9), LSA(KC_8), LSA(KC_9), ______, ______), */ #define LS_LT5 KC_TRNS #define LS_LT4 KC_Z #define LS_LT3 KC_Q -#define LS_LT2 RALT(KC_5) -#define LS_LT1 LALT(KC_7) -#define LS_LT0 LSA(KC_7) -#define LS_RT0 LALT(KC_4) +#define LS_LT2 SK_SECT +#define LS_LT1 SK_PARA +#define LS_LT0 SK_DCRS +#define LS_RT0 SK_CENT #define LS_RT1 KC_DLR -#define LS_RT2 A(S(KC_2)) -#define LS_RT3 RALT(KC_3) -#define LS_RT4 LALT(KC_Y) +#define LS_RT2 SK_EURO +#define LS_RT3 SK_BPND +#define LS_RT4 SK_JPY #define LS_RT5 KC_TRNS #define LS_LM5 KC_TRNS @@ -55,8 +55,8 @@ __ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND #define LS_LM3 KC_LBRC #define LS_LM2 KC_LPRN #define LS_LM1 KC_LCBR -#define LS_LM0 RSA(KC_5) -#define LS_RM0 RALT(KC_1) +#define LS_LM0 SK_SCRS +#define LS_RM0 SK_IEXC #define LS_RM1 RSFT_T(KC_PAST) #define LS_RM2 RGUI_T(KC_PEQL) #define LS_RM3 RALT_T(KC_PPLS) @@ -86,6 +86,8 @@ __ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND #define LS_LH2 SK_DELWDL #define LS_LH1 SK_DELWDR #define LS_LH0 KC_VOLU +#define LS_LHA KC_NO +#define LS_RHA KC_NO #define LS_RH0 LALT(KC_9) #define LS_RH1 LSA(KC_8) #define LS_RH2 LSA(KC_9) @@ -158,6 +160,8 @@ __ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND #define LF_LH2 KC_SCLN #define LF_LH1 TG(L_NUM) #define LF_LH0 KC_TRNS +#define LF_LHA KC_NO +#define LF_RHA KC_NO #define LF_RH0 KC_TRNS #define LF_RH1 KC_0 #define LF_RH2 KC_DOT @@ -230,8 +234,8 @@ __ │ UNDO CUT COPY PSTE SPC │ __ __ __ __ │ PCMM #define LN_LH2 LGUI_T(KC_BSPC) #define LN_LH1 LSFT_T(KC_ENT) #define LN_LH0 KC_DEL -#define LN_LHA KC_TRNS -#define LN_RHA KC_TRNS +#define LN_LHA KC_NO +#define LN_RHA KC_NO #define LN_RH0 KC_C #define LN_RH1 KC_P0 #define LN_RH2 KC_PDOT @@ -302,7 +306,9 @@ __ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND #define LV_LH3 KC_TRNS #define LV_LH2 S(KC_APP) #define LV_LH1 KC_APP -#define LV_LH0 KC_TRNS +#define LV_LH0 KC_NO +#define LV_LHA KC_NO +#define LV_RHA KC_NO #define LV_RH0 SK_ZOOMOUT #define LV_RH1 SK_HISTPRV #define LV_RH2 SK_HISTNXT @@ -364,6 +370,8 @@ __ │ UNDO CUT COPY PSTE PSTM │ TAB __ __ ESC │ DOCEND #define LC_LH2 KC_NO #define LC_LH1 TG(L_NUM) #define LC_LH0 KC_NO +#define LC_LHA KC_NO +#define LC_RHA KC_NO #define LC_RH0 KC_NO #define LC_RH1 KC_NO #define LC_RH2 KC_NO diff --git a/moutis_matrix.c b/moutis_matrix.c index e295176..c84b463 100644 --- a/moutis_matrix.c +++ b/moutis_matrix.c @@ -71,19 +71,31 @@ void matrix_scan_user(void) { tap_code16(KC_LEFT); break; - case KC_QUOT: // + case KC_QUOT: // ‘|’ single paired quotes tap_code16(KC_BSPC); tap_SemKey(SK_SQUL); tap_SemKey(SK_SQUR); tap_code16(KC_LEFT); break; - case KC_DQUO: // + case KC_DQUO: // “|” double paired quotes tap_code16(KC_BSPC); - clear_keyboard(); // QMK doesn't let go of shift here? - tap_SemKey(SK_SDQL); - tap_SemKey(SK_SDQR); + clear_keyboard(); // QMK doesn't let go of shift here? + tap_SemKey(SK_SDQL); // “ + tap_SemKey(SK_SDQR); // ” tap_code(KC_LEFT); break; + case SK_FDQL: // « | » double French quote + tap_SemKey(SK_FDQR); + goto pushspaceshere; + case SK_FSQL: // ‹ | › single French quote + tap_SemKey(SK_FSQR); +pushspaceshere: + tap_code(KC_LEFT); // break up 2 dble spc + tap_code16(KC_SPACE); // to thwart "smart" EOS. + tap_code(KC_LEFT); + tap_code16(KC_SPACE); + //unregister_SemKey(linger_key); + break; default: break; diff --git a/moutis_process_record.c b/moutis_process_record.c index 0dc0f9b..f82da9c 100644 --- a/moutis_process_record.c +++ b/moutis_process_record.c @@ -252,11 +252,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (saved_mods & MOD_MASK_SHIFT) { // SHFT too? tap_SemKey(SK_SECT); // } else { - tap_code16(A(KC_7)); // this should be semkey for ¶ + tap_SemKey(SK_PARA); // this should be semkey for ¶ } return_state = false; // stop processing this record. } else if (saved_mods & MOD_MASK_SHIFT) { // only SHFT down - tap_code16(S(A(KC_MINS))); // this should be semkey for — M-Dash + tap_SemKey(SK_MDSH); // this should be semkey for — M-Dash return_state = false; // stop processing this record. } break; @@ -271,18 +271,18 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return_state = false; // stop processing this record. } else if (saved_mods & MOD_MASK_SHIFT) { // only SHFT down - tap_code16(A(KC_SCLN)); // this should be semkey for … + tap_SemKey(SK_ELPS); // semkey for … return_state = false; // stop processing this record. } break; - case KC_QUOT: // SHIFT = [ (linger=[|]), ALT=«, ALT+SHIFT=‹ + case KC_DQUO: // SHIFT = [ (linger=[|]), ALT=«, ALT+SHIFT=‹ clear_keyboard(); // clean record to tinker with. if (saved_mods & MOD_MASK_ALT) { // ALT (only) down? if (saved_mods & MOD_MASK_SHIFT) { // SHFT too? - tap_code16(SQUO_SA);// this should be semkey for ‹? - } else { // alt & shift? - tap_code16(SQUO_A);// this should be linger on semkey for «? + register_linger_key(SK_FSQL); // linger on semkey for ‹ + } else { // only alt? + register_linger_key(SK_FDQL); // linger on semkey for « } return_state = false; // don't do more with this record. #ifndef JP_MODE_ENABLE @@ -291,23 +291,19 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else if (((saved_mods & MOD_MASK_SHIFT) && IS_ENGLISH_MODE) // SHFT (only) || (!saved_mods && !IS_ENGLISH_MODE)) { // or no mods & not in english #endif -// register_linger_key(user_config.RBRC_key); // example of simple linger macro register_linger_key(SQUO_S); // example of simple linger macro return_state = false; // don't do more with this record. } else //{ // no mods, so linger goto byteshave; // CAUTION: messing w/stack frame here!! -// register_linger_key(keycode); // example of simple linger macro -// return_state = false; // don't do more with this record. -// } break; - case KC_DQUO: // SHIFT = ], ALT=», ALT+SHIFT=› + case KC_QUOT: // SHIFT = ], ALT=», ALT+SHIFT=› clear_keyboard(); // clean record to tinker with. if (saved_mods & MOD_MASK_ALT) { // ALT (only) down? if (saved_mods & MOD_MASK_SHIFT) { // SHFT too? - tap_code16(DQUO_SA);// this should be semkey for ›? + tap_SemKey(SK_FSQR); // semkey for › } else { - tap_code16(DQUO_A);// this should be linger on semkey for »? + tap_SemKey(SK_FDQR); // semkey for » } return_state = false; // don't do more with this record. #ifndef JP_MODE_ENABLE @@ -316,7 +312,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else if (((saved_mods & MOD_MASK_SHIFT) && IS_ENGLISH_MODE) // SHFT (only) || (!saved_mods && !IS_ENGLISH_MODE)) { // or no mods & not in english #endif -// register_linger_key(user_config.RBRC_key); // example of simple linger macro register_linger_key(DQUO_S); // example of simple linger macro return_state = false; // don't do more with this record. } else { // no mods, so @@ -464,10 +459,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // break; - case KC_DQUO: // SHIFT = ], ALT=›, ALT+SHIFT=» - case KC_QUOT: // SHIFT = [ (linger=[|]), ALT=‹, ALT+SHIFT=« - unregister_linger_key(); // stop lingering - unregister_code16(keycode); // may still need to handle this + case SK_FDQL: // « + case SK_FSQL: // ‹ + case KC_BSLS: // actual keycode for « & » + case KC_QUOT: // SHIFT = ], ALT=›, ALT+SHIFT=» + case KC_DQUO: // SHIFT = [ (linger=[|]), ALT=‹, ALT+SHIFT=« + unregister_linger_key(); // stop any lingering + //unregister_code16(keycode); // may still need to handle this return_state = false; // stop processing this record. break; diff --git a/moutis_semantickeys.c b/moutis_semantickeys.c index 269875d..7082e10 100644 --- a/moutis_semantickeys.c +++ b/moutis_semantickeys.c @@ -102,12 +102,26 @@ const uint16_t SemKeys_t[SemKeys_COUNT - SK_KILL][OS_count] = { [SK_APPPRV - SK_KILL] = {RGUI(RSFT(KC_TAB)),A(S(KC_TAB))}, // APP switcher Prev (least recently used) [SK_WINNXT - SK_KILL] = {RCTL(KC_TAB),C(KC_TAB)}, // Window/tab switcher Next [SK_WINPRV - SK_KILL] = {RCTL(RSFT(KC_TAB)),C(S(KC_TAB))}, // Window/tab switcher Prev - [SK_SECT - SK_KILL] = {A(KC_5),0xE167}, // § ** SAMPLE OF GLYPH. REALLY NEED UNICODE. - [SK_ENYE - SK_KILL] = {A(KC_N),A(KC_N)}, // ñ/Ñ ** SAMPLE OF GLYPH. REALLY NEED UNICODE? + // Punctuation + [SK_SECT - SK_KILL] = {A(KC_5),0xE167}, // § ** need Win Compose via BCD. + [SK_ENYE - SK_KILL] = {A(KC_N),A(KC_N)}, // ñ/Ñ ** need Win Compose via BCD? + [SK_IEXC - SK_KILL] = {RALT(KC_1),RALT(KC_1)}, // ¡ Inverted exclamation mark ** need Win Compose via BCD? + [SK_ELPS - SK_KILL] = {A(KC_SCLN),A(KC_SCLN)}, // … ** need Win Compose via BCD? + [SK_PARA - SK_KILL] = {A(KC_7),A(KC_7)}, // ¶ ** need Win Compose via BCD? + [SK_MDSH - SK_KILL] = {S(A(KC_MINS)),S(A(KC_MINS))}, // — ** need Win Compose via BCD? + [SK_DCRS - SK_KILL] = {LSA(KC_7),LSA(KC_7)}, // ‡ Double Cross ** need Win Compose via BCD? + [SK_SCRS - SK_KILL] = {RSA(KC_5),RSA(KC_5)}, // † Single Cross ** need Win Compose via BCD? + [SK_BBLT - SK_KILL] = {LALT(KC_8),LALT(KC_8)}, // • Bold Bullet ** need Win Compose via BCD? + // Currency + [SK_CENT - SK_KILL] = {LALT(KC_4),LALT(KC_4)}, // ¢ ** need Win Compose via BCD? + [SK_EURO - SK_KILL] = {A(S(KC_2)),A(S(KC_2))}, // € ** need Win Compose via BCD? + [SK_BPND - SK_KILL] = {RALT(KC_3),RALT(KC_3)}, // £ ** need Win Compose via BCD? + [SK_JPY - SK_KILL] = {LALT(KC_Y),LALT(KC_Y)}, // ¥ ** need Win Compose via BCD? + // Quotations [SK_SQUL - SK_KILL] = {A(KC_RBRC),A(KC_RBRC)}, // ’ ** Left single quote UNICODE? [SK_SQUR - SK_KILL] = {S(A(KC_RBRC)),S(A(KC_RBRC))}, // ’ ** Right single quote UNICODE? - [SK_SDQL - SK_KILL] = {A(KC_LBRC),A(KC_LBRC)}, // ’ ** Left double quote UNICODE? - [SK_SDQR - SK_KILL] = {A(S(KC_LBRC)),A(S(KC_LBRC))}, // ’ ** Right double quote UNICODE? + [SK_SDQL - SK_KILL] = {A(KC_LBRC),A(KC_LBRC)}, // “ ** Left double quote UNICODE? + [SK_SDQR - SK_KILL] = {A(S(KC_LBRC)),A(S(KC_LBRC))}, // ” ** Right double quote UNICODE? [SK_FDQL - SK_KILL] = {A(KC_BSLS),A(KC_BSLS)}, // « Left double French quote UNICODE? [SK_FDQR - SK_KILL] = {S(A(KC_BSLS)),S(A(KC_BSLS))}, // » Right double French quote UNICODE? [SK_FSQL - SK_KILL] = {S(A(KC_3)),A(KC_LBRC)}, // ‹ Left single French quote UNICODE? @@ -122,77 +136,15 @@ bool process_semkey(uint16_t keycode, const keyrecord_t *record) { saved_mods = get_mods(); if (record->event.pressed) { switch (keycode) { -/* // - // demonstrator. can handle multi-keystrokes here + // handle multi-keystroke semkeys here // - case SK_umluatU: // Ü - tap_code16(A(KC_U)); - tap_code16(KC_U); - break; - case SK_umluatO: // Ö - tap_code16(A(KC_U)); - tap_code16(KC_O); - break; - case SK_ringU: // Ů - tap_code16(A(KC_K)); - tap_code16(KC_U); - break; - case SK_ringO: // - tap_code16(A(KC_K)); - tap_code16(KC_O); - break; - case SK_caretU: // Û - tap_code16(A(KC_6)); - tap_code16(KC_U); - break; - case SK_caretO: // Ô - tap_code16(A(KC_6)); - tap_code16(KC_O); - break; - case SK_acuteU: // Ú - tap_code16(A(KC_E)); - tap_code16(KC_U); - break; - case SK_acuteO: // Ó - tap_code16(A(KC_E)); - tap_code16(KC_O); - break; - - case SK_acuteE: // É - tap_code16(A(KC_E)); - tap_code16(KC_E); - break; - case SK_macronE: // Ē - tap_code16(A(KC_A)); - tap_code16(KC_O); - break; - case SK_caretE: // Ê - tap_code16(A(KC_6)); - tap_code16(KC_E); - break; -*/ -/* - Example of custom behaviors. - */ case SK_SWRD: // Select current word tap_SemKey(SK_WORDPRV); register_code(KC_LSFT); // shift for select is close to universal? tap_SemKey(SK_WORDNXT); // of course, not for VIM and the like, unregister_code(KC_LSFT); // but we're talking OS platforms? break; - case SK_SCAP: // screen capture to clipboard - tap_SemKey(SK_SCAP); // default probably works, but since only tap is desired, we'll tap it here. - break; - case SK_SCLP: // selection capture to clipboard - tap_SemKey(SK_SCLP); - break; - case SK_CUT: // cut - tap_SemKey(SK_CUT); - break; - case SK_COPY: - tap_SemKey(SK_COPY); - break; case SK_ENYE: // ñ/Ñ ENYE // Doing it this way until proper multi-keystroke table is implemented if (user_config.AdaptiveKeys @@ -223,11 +175,14 @@ bool process_semkey(uint16_t keycode, const keyrecord_t *record) { #ifdef JP_MODE_ENABLE IS_ENGLISH_MODE = true; #endif - tap_SemKey(SK_MHEN); // Mac/Win/iOS all different? + tap_SemKey(SK_MHEN); // Mac/Win/iOS/Lux all different? // return_state = false; // stop processing this record. break; - default: // default keydown event + default: // default keydown event (from the semkey table) register_SemKey(keycode); +/* Add the BCD decode for Win compose key stuff here + +*/ break; } } else { // The keyup event diff --git a/moutis_semantickeys.h b/moutis_semantickeys.h index de9cfc5..654ded2 100644 --- a/moutis_semantickeys.h +++ b/moutis_semantickeys.h @@ -26,7 +26,11 @@ enum my_keycodes { - SK_KILL = SAFE_RANGE, // SK_KILL must be the first of contiguous block of SKs + HD_AdaptKeyToggle = SAFE_RANGE, // Adaptive Keys Toggle on/off + HD_L_QWERTY, // base layer switch + HD_L_ALPHA, + // Semantic Keys (keystrokes handled by process_semkey() for platform independence) + SK_KILL, // SK_KILL must be the first of contiguous block of SKs SK_HENK, // kana (others) SK_MHEN, // eisuu (others) SK_HENT, // Hard-Enter @@ -66,20 +70,31 @@ enum my_keycodes { SK_APPPRV, // APP switcher Prev (least recently used) SK_WINNXT, // Window/tab switcher Next SK_WINPRV, // Window/tab switcher Prev - SK_SECT, // § + // Punctuation + SK_SECT, // § Section symbol SK_ENYE, // ñ/Ñ ENYE - SK_SQUL, // ’ ** Left single quote UNICODE? - SK_SQUR, // ’ ** Right single quote UNICODE? - SK_SDQL, // ’ ** Left double quote UNICODE? - SK_SDQR, // ’ ** Right double quote UNICODE? - SK_FDQL, // ’ « Left double French quote UNICODE? - SK_FDQR, // ’ » Right double French quote UNICODE? - SK_FSQL, // ’ ‹ Left single French quote UNICODE? S(A(3)) - SK_FSQR, // ’ › Right single French quote UNICODE? S(A(4)) - SemKeys_COUNT, // end of non-glyph SemKeys - HD_AdaptKeyToggle, - HD_L_QWERTY, - HD_L_ALPHA, + SK_IEXC, // ¡ Inverted exclamation mark + SK_ELPS, // … Elipsis + SK_PARA, // ¶ Paragraph symbol + SK_MDSH, // — M-Dash + SK_DCRS, // ‡ Double Cross + SK_SCRS, // † Single Cross + SK_BBLT, // • Bold Bullet + // Currency + SK_CENT, // ¢ + SK_EURO, // € + SK_BPND, // £ + SK_JPY, // ¥ + // Quotations + SK_SQUL, // ’ Left single quote (linger for paired) + SK_SQUR, // ’ Right single quote + SK_SDQL, // ’ Left double quote (linger for paired) + SK_SDQR, // ’ Right double quote + SK_FDQL, // ’ « Left double French quote (linger for paired) + SK_FDQR, // ’ » Right double French quote + SK_FSQL, // ’ ‹ Left single French quote (linger for paired) + SK_FSQR, // ’ › Right single French quote + SemKeys_COUNT, // end of SemKeys /* Eventually…these should be handled as SemKeys with BCD & Alt-gr for Windows? @@ -121,3 +136,5 @@ enum my_keycodes { #define register_SemKey(sk) register_code16(SemKeys_t[sk - SK_KILL][user_config.OSIndex]) #define unregister_SemKey(sk) unregister_code16(SemKeys_t[sk - SK_KILL][user_config.OSIndex]) +#define linger_SemKey(sk) {register_code16(SemKeys_t[sk - SK_KILL][user_config.OSIndex]);linger_key = sk;linger_timer = state_reset_timer = timer_read();} +#define unlinger_SemKey(sk) {unregister_code16(SemKeys_t[linger_key - SK_KILL][user_config.OSIndex]);linger_key = 0;}