Avant fusion

This commit is contained in:
Kawamashi 2025-04-27 17:48:52 +02:00
commit f1ddb3df0d
7 changed files with 46 additions and 31 deletions

View file

@ -128,10 +128,20 @@ void get_clever_keycode(uint16_t* next_keycode, keyrecord_t* record) {
bkspc_countdown = 0; bkspc_countdown = 0;
return replace_ongoing_key(FG_I, next_keycode, record); return replace_ongoing_key(FG_I, next_keycode, record);
case FG_T: case FG_EACU:
bkspc_countdown = 0;
return replace_ongoing_key(FG_I, next_keycode, record);
case FG_VIRG:
// éa SFB
bkspc_countdown = 0;
return replace_ongoing_key(FG_A, next_keycode, record);
case FG_S:
invoke_key(FG_I, record); invoke_key(FG_I, record);
case FG_I: case FG_I:
return finish_word((uint16_t[]) {FG_O, FG_N}, 2, next_keycode, record); return finish_word((uint16_t[]) {FG_O, FG_T}, 2, next_keycode, record);
//return finish_word((uint16_t[]) {FG_O, FG_N}, 2, next_keycode, record);
case FG_C: case FG_C:
return finish_word((uint16_t[]) {FG_APOS, FG_E, FG_S, FG_T}, 4, next_keycode, record); return finish_word((uint16_t[]) {FG_APOS, FG_E, FG_S, FG_T}, 4, next_keycode, record);
@ -146,8 +156,10 @@ void get_clever_keycode(uint16_t* next_keycode, keyrecord_t* record) {
// "avec" // "avec"
return finish_word((uint16_t[]) {FG_V, FG_E, FG_C}, 3, next_keycode, record); return finish_word((uint16_t[]) {FG_V, FG_E, FG_C}, 3, next_keycode, record);
case FG_S: case FG_N:
return finish_word((uint16_t[]) {FG_U, FG_R}, 2, next_keycode, record); // sc SFB
bkspc_countdown = 0;
return replace_ongoing_key(FG_L, next_keycode, record);
case FG_B: case FG_B:
process_word((uint16_t[]) {FG_O, FG_N, FG_J}, 3, record); process_word((uint16_t[]) {FG_O, FG_N, FG_J}, 3, record);
@ -232,13 +244,13 @@ void get_clever_keycode(uint16_t* next_keycode, keyrecord_t* record) {
} }
break; break;
case FG_O: /* case FG_O:
if (prev_keycode == FG_U && recent[RECENT_SIZE - 2] != FG_Q) { if (prev_keycode == FG_U && recent[RECENT_SIZE - 2] != FG_Q) {
// "uo" -> "un" // "uo" -> "un"
bkspc_countdown = 0; bkspc_countdown = 0;
return replace_ongoing_key(FG_N, next_keycode, record); return replace_ongoing_key(FG_N, next_keycode, record);
} }
break; break; */
case OU_GRV: case OU_GRV:
layer_off(_ODK); layer_off(_ODK);

View file

@ -16,7 +16,7 @@
#include "odk_layer.h" #include "odk_layer.h"
static uint16_t odk_keycode = KC_NO; //static uint16_t odk_keycode = KC_NO;
bool process_odk_layer(uint16_t keycode, keyrecord_t *record) { bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
@ -39,9 +39,9 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
del_oneshot_mods(MOD_MASK_SHIFT); del_oneshot_mods(MOD_MASK_SHIFT);
unregister_mods(MOD_MASK_SHIFT); unregister_mods(MOD_MASK_SHIFT);
} }
layer_on(_ODK); /*layer_on(_ODK);
odk_keycode = KC_NO; odk_keycode = KC_NO;
return false; return false; */
} else if (keycode == FG_ODK) { } else if (keycode == FG_ODK) {
// Special behaviour of FR_ODK when shifted // Special behaviour of FR_ODK when shifted
@ -56,7 +56,7 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
return true; return true;
} else if (IS_LAYER_ON(_ODK)) { } else if (IS_LAYER_ON(_ODK)) {
if (odk_keycode == KC_NO) { odk_keycode = keycode; } //if (odk_keycode == KC_NO) { odk_keycode = keycode; }
//if (!IS_QK_USER(keycode)) { odk_keycode = keycode; } //if (!IS_QK_USER(keycode)) { odk_keycode = keycode; }
switch (keycode) { switch (keycode) {
@ -95,10 +95,10 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
is_shifted = false; is_shifted = false;
} }
//exit_odk = true; //exit_odk = true;
} else { /* } else {
odk_keycode = KC_NO; odk_keycode = KC_NO; */
} }
} else { // On release /* } else { // On release
switch (keycode) { switch (keycode) {
case OS_ODK: case OS_ODK:
case FG_ODK: case FG_ODK:
@ -109,14 +109,14 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
layer_off(_ODK); layer_off(_ODK);
odk_keycode = KC_NO; odk_keycode = KC_NO;
} }
} } */
} }
return true; return true;
} }
void odk_layer_exit_check(uint16_t keycode) { /* void odk_layer_exit_check(uint16_t keycode) {
if (keycode == odk_keycode) { if (keycode == odk_keycode) {
layer_off(_ODK); layer_off(_ODK);
odk_keycode = KC_NO; odk_keycode = KC_NO;
} }
} } */

View file

@ -25,7 +25,7 @@ extern "C" {
#endif #endif
bool process_odk_layer(uint16_t keycode, keyrecord_t *record); bool process_odk_layer(uint16_t keycode, keyrecord_t *record);
void odk_layer_exit_check(uint16_t keycode); //void odk_layer_exit_check(uint16_t keycode);
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -81,6 +81,9 @@ bool process_custom_tap_hold(uint16_t keycode, keyrecord_t *record) {
case SFT_T(COPY): case SFT_T(COPY):
return process_tap_hold(C(FG_C), record); return process_tap_hold(C(FG_C), record);
case LT_NUMWORD:
return process_numword(NUMWORD, record);
case LT_REPT: case LT_REPT:
repeat_key_invoke(&record->event); repeat_key_invoke(&record->event);
return false; return false;

View file

@ -63,7 +63,7 @@ uint16_t tap_hold_extractor(uint16_t keycode) {
bool caps_word_press_user(uint16_t keycode) { bool caps_word_press_user(uint16_t keycode) {
// Caps Word shouldn't be applied with Alt-gr // Caps Word shouldn't be applied with Alt-gr
// Managing underscore on alt gr + E/T. // Managing underscore and slash on alt gr + E/T.
// Underscore and slash must continue Caps Word, without shifting. // Underscore and slash must continue Caps Word, without shifting.
if ((get_mods() & MOD_BIT(KC_ALGR))) { if ((get_mods() & MOD_BIT(KC_ALGR))) {
switch (keycode) { switch (keycode) {
@ -96,10 +96,9 @@ bool caps_word_press_user(uint16_t keycode) {
} }
} }
//
// Keycodes that continue Caps Word, with shift applied. // Keycodes that continue Caps Word, with shift applied.
if (isLetter(keycode)) { // @ must be shifted, bc of CleverKeys using it.
if (isLetter(keycode) || isSendStringMacro(keycode) || keycode == FG_AROB) {
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key. add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true; return true;
} }

View file

@ -115,7 +115,7 @@ void post_process_record_user(uint16_t keycode, keyrecord_t* record) {
//if (os4a_layer != 0 && exit_os4a_layer) { os4a_layer_off(os4a_layer); } //if (os4a_layer != 0 && exit_os4a_layer) { os4a_layer_off(os4a_layer); }
os4a_layer_exit_check(); os4a_layer_exit_check();
numword_exit_check(); numword_exit_check();
odk_layer_exit_check(keycode); //odk_layer_exit_check(keycode);
end_CK(record); end_CK(record);
} }
@ -223,10 +223,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------' `----------------------------------' * `----------------------------------' `----------------------------------'
*/ */
[_NUMBERS] = LAYOUT( [_NUMBERS] = LAYOUT(
_______, _______, FG_ASTX, FG_EGAL, KC_7, FG_PERC, S(FG_ACIR), _______, FG_PLUS, FG_MOIN, _______, _______, _______, _______, FG_MOIN, FG_PLUS, KC_7, S(FG_ACIR), FG_PERC, _______, FG_EGAL, FG_ASTX, _______, _______,
_______, KC_4, KC_3, KC_2, MT_1, _______, FG_CARN, MT_SLSH, KC_6, KC_7, KC_8, _______, _______, KC_4, KC_3, KC_2, MT_1, FG_CARN, _______, MT_SLSH, KC_6, KC_7, KC_8, _______,
_______, _______, _______, _______, KC_5, _______, _______, _______, _______, _______, _______, KC_9, KC_6, _______, FG_ODK, _______, _______, _______, _______, _______, KC_5, _______, _______, _______, _______, _______, _______, KC_9, KC_6, _______, FG_ODK, _______,
_______, _______, KC_PDOT, KC_0 , NUMWORD, LT_REPT, KC_SPC, _______, _______, _______ _______, _______, KC_PDOT, KC_0 , LT_NUMWORD, LT_REPT, KC_SPC, _______, _______, _______
), ),
@ -247,7 +247,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_ODK] = LAYOUT( [_ODK] = LAYOUT(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, OU_GRV, _______, _______, FG_3PTS, _______, _______, FG_J, FG_D, FG_AROB, _______, _______, _______, OU_GRV, _______, _______, FG_3PTS, _______, _______, FG_J, FG_D, FG_AROB, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, FG_CCED, _______, FG_K, CNL_ODK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, FG_K, CNL_ODK, _______,
_______, _______, _______, _______, FG_ECIR, _______, _______, _______, _______, _______ _______, _______, _______, _______, FG_ECIR, _______, _______, _______, _______, _______
), ),

View file

@ -68,22 +68,23 @@ enum custom_keycodes {
OS_RALT, OS_RALT,
OS_LALT, OS_LALT,
OS_WIN, OS_WIN,
OS_ODK, //OS_ODK,
CNL_ODK CNL_ODK
}; };
// Layer taps // Layer taps
#define LT_SPC ALGR_T(KC_SPC) #define LT_SPC ALGR_T(KC_SPC)
#define LT_E ALGR_T(FG_E) #define LT_E ALGR_T(FG_E)
#define LT_REPT LT(_NUMBERS, KC_0) #define LT_REPT LT(_NUMBERS, KC_1)
#define LT_MGC LT(_SHORTNAV, KC_0) #define LT_MGC LT(_SHORTNAV, KC_1)
#define OS_FA OSL(_FUNCAPPS) #define OS_FA OSL(_FUNCAPPS)
#define TT_FA TT(_FUNCAPPS) #define TT_FA TT(_FUNCAPPS)
#define TG_APOD TG(_APOS_DR) #define TG_APOD TG(_APOS_DR)
#define MT_SLSH SFT_T(FG_SLSH) #define MT_SLSH SFT_T(FG_SLSH)
#define MT_1 SFT_T(KC_1) #define MT_1 SFT_T(KC_1)
#define LT_NUMWORD LT(_SHORTNAV, NUMWORD)
#define E_CIRC S(FG_0) #define E_CIRC S(FG_0)
//#define OS_ODK OSL(_ODK) #define OS_ODK OSL(_ODK)
// One shot mods // One shot mods
#define L_OS4A LSFT_T(OS4A) #define L_OS4A LSFT_T(OS4A)