création word_conf

This commit is contained in:
Kawamashi 2025-09-29 22:34:46 +02:00
commit 29076f534d
18 changed files with 287 additions and 582 deletions

View file

@ -1,8 +1,10 @@
#include "capslist.h"
static bool caps_list_active = false;
static unsigned short int capslist_countdown = 0;
static unsigned short int countdown_end = 5;
//static unsigned short int capslist_countdown = 0;
unsigned short int capslist_countdown = 0;
//static unsigned short int countdown_end = 5;
unsigned short int countdown_end = 5;
bool is_caps_list_on(void) { return caps_list_active; }
@ -65,50 +67,4 @@ bool process_caps_list(uint16_t keycode, keyrecord_t *record) {
}
disable_caps_list();
return true;
}
bool should_continue_caps_list(uint16_t keycode) {
if (keycode == KC_BSPC) {
capslist_countdown--;
return true;
}
if (is_letter(keycode) || is_send_string_macro(keycode) || keycode == PG_AROB) {
capslist_countdown++;
return true;
}
if (caps_word_press_user(keycode)) {
capslist_countdown++;
return true;
}
// Keycodes that continue Caps List, but not Caps Word.
// These keycodes trigger the countdown to end Caps List.
switch (keycode) {
case PG_VIRG:
case KC_SPC:
capslist_countdown++;
return true;
}
return false; // Deactivate Caps List.
}
bool caps_word_reactivation(void) {
// Words that continue Caps List.
if (recent[RECENT_SIZE - 1] == KC_SPC) {
if (recent[RECENT_SIZE - 4] == KC_SPC && recent[RECENT_SIZE - 3] == PG_E && recent[RECENT_SIZE - 2] == PG_T) {
countdown_end = 1;
return true;
}
if (recent[RECENT_SIZE - 4] == KC_SPC && recent[RECENT_SIZE - 3] == PG_O && recent[RECENT_SIZE - 2] == PG_U) {
countdown_end = 1;
return true;
}
if (recent[RECENT_SIZE - 2] == PG_VIRG) {
return true;
}
}
return false;
}
}

View file

@ -3,6 +3,9 @@
#include "quantum.h"
#include "keymap.h"
extern unsigned short int capslist_countdown;
extern unsigned short int countdown_end;
bool is_caps_list_on(void);
void enable_caps_list(void);

View file

@ -1,221 +0,0 @@
// Correction automatique
#include "clever_keys.h"
bool process_clever_keys(uint16_t keycode, keyrecord_t* record) {
uint16_t next_keycode = get_next_keycode(keycode, record);
const uint8_t mods = get_mods();
if (next_keycode != KC_NO) {
uint16_t prev_keycode = recent[RECENT_SIZE - 1];
//const uint8_t mods = get_mods();
if (is_letter(next_keycode) || next_keycode == E_CIRC) {
switch (prev_keycode) {
case PG_EXCL:
case PG_QUES:
case PG_3PTS:
case PG_2PTS:
// Add space between punctuation and letters.
process_next_key(KC_SPC, record);
case KC_SPC:
switch (recent[RECENT_SIZE - 2]) {
case PG_EXCL:
case PG_QUES:
case PG_3PTS:
case PG_X:
// Add OS shift at the beginning of a sentence.
if (!is_caps_lock_on()) { set_oneshot_mods(MOD_BIT(KC_LSFT)); }
break;
}
}
}
// Ajout automatique du "u" après le "q"
if (prev_keycode == PG_Q) {
switch (next_keycode) {
case PG_E:
case PG_I:
case PG_A:
case PG_O:
case PG_U:
case E_CIRC:
case PG_APOS:
process_next_key(PG_L, record);
break;
// Raccourci pour "quelq"
case PG_Q:
clear_recent_keys(); // To prevent infinite loop
process_word((uint16_t[]) {PG_L, PG_E, PG_C}, 3, record);
break;
// Raccourci pour "quoi", ça évite un aller-retour sur la main gauche.
case PG_Z:
return finish_word((uint16_t[]) {PG_L, PG_O, PG_I}, 3, record);
// Raccourci pour "quand"
case PG_H:
process_word((uint16_t[]) {PG_L, PG_A, PG_S}, 3, record);
break;
}
} else if (next_keycode == PG_AROB && !is_letter(recent[RECENT_SIZE - 2])) {
switch (prev_keycode) {
case PG_N:
// "t@" -> "toujours"
return finish_word((uint16_t[]) {PG_O, PG_L, PG_J, PG_O, PG_L, PG_R, PG_T}, 7, record);
case PG_P:
// "p@" -> "peut-être"
return finish_word((uint16_t[]) {PG_E, PG_L, PG_N, PG_MOIN, PG_ACIR, PG_E, PG_N, PG_R, PG_E}, 9, record);
case PG_A:
// "a@" -> "aujourd'hui"
return finish_word((uint16_t[]) {PG_L, PG_J, PG_O, PG_L, PG_R, PG_H, PG_APOS, PG_F, PG_L, PG_I}, 10, record);
case PG_B:
// "b@" -> "beaucoup"
return finish_word((uint16_t[]) {PG_E, PG_A, PG_L, PG_D, PG_O, PG_L, PG_P}, 7, record);
case PG_E:
// "e@" -> "est-ce qu"
return finish_word((uint16_t[]) {PG_T, PG_N, PG_MOIN, PG_D, PG_E, KC_SPC, PG_Q}, 7, record);
case PG_H:
// "d@" -> "déjà"
return finish_word((uint16_t[]) {PG_U, PG_J, PG_AGRV}, 3, record);
}
} else if (prev_keycode == PG_P) {
switch (next_keycode) {
case PG_M:
// "pas"
return finish_word((uint16_t[]) {PG_A, PG_T}, 2, record);
case PG_APOS:
// "par"
return finish_word((uint16_t[]) {PG_A, PG_R}, 2, record);
case PG_X:
if (!is_letter(recent[RECENT_SIZE - 2])) {
// "pour"
return finish_word((uint16_t[]) {PG_O, PG_L, PG_R}, 3, record);
}
}
} else if (next_keycode == PG_A && prev_keycode == PG_O) {
// "oa" -> "oi"
process_next_key(PG_I, record);
return false;
} else if (next_keycode == PG_O && prev_keycode == PG_L && recent[RECENT_SIZE - 2] != PG_Q) {
// "uo" -> "un"
process_next_key(PG_S, record);
return false;
}
switch (next_keycode) {
case PG_QUES:
case PG_EXCL:
// On ajoute un espace insécable s'il n'a pas été entré avant le point d'exclamation.
// Il ne faut pas tester cette fonctionnalité avec Word, qui ajoute cet espace automatiquement.
if (is_letter(recent[RECENT_SIZE - 1])) {
if ((mods | get_oneshot_mods() | get_weak_mods()) & MOD_MASK_SHIFT) {
del_weak_mods(MOD_MASK_SHIFT);
del_oneshot_mods(MOD_MASK_SHIFT);
unregister_mods(MOD_MASK_SHIFT);
}
process_next_key(ALGR(KC_SPC), record);
set_mods(mods);
process_next_key(next_keycode, record);
return false;
}
break;
case MAGIC:
switch (prev_keycode) {
case PG_N:
process_next_key(PG_I, record);
case PG_I:
return finish_word((uint16_t[]) {PG_O, PG_S}, 2, record);
case PG_D:
return finish_word((uint16_t[]) {PG_APOS, PG_E, PG_T, PG_N}, 4, record);
case PG_H:
return finish_word((uint16_t[]) {PG_A, PG_S, PG_T}, 3, record);
case PG_P:
return finish_word((uint16_t[]) {PG_C, PG_L, PG_T}, 3, record);
case PG_A:
return finish_word((uint16_t[]) {PG_G, PG_E, PG_D}, 3, record);
case PG_T:
return finish_word((uint16_t[]) {PG_L, PG_R}, 2, record);
case PG_B:
process_word((uint16_t[]) {PG_O, PG_S, PG_J}, 3, record);
case PG_J:
return finish_word((uint16_t[]) {PG_O, PG_L, PG_R}, 3, record);
case PG_M:
// "même"
return finish_word((uint16_t[]) {PG_ACIR, PG_E, PG_M, PG_E}, 4, record);
default:
return false;
}
case PG_Q:
if (prev_keycode == PG_J) {
// "jq" -> "jusqu"
process_word((uint16_t[]) {PG_L, PG_T}, 2, record);
}
break;
case CA_CED:
return finish_word((uint16_t[]) {PG_CCED, PG_A}, 2, record);
case OU_GRV:
return finish_word((uint16_t[]) {PG_O, ALGR(PG_L)}, 2, record);
case AGRV_SPC:
return finish_word((uint16_t[]) {PG_AGRV, KC_SPC}, 2, record);
case E_CIRC:
return process_accent(PG_ACIR, PG_E, record);
case I_CIRC:
return process_accent(PG_ACIR, PG_I, record);
case A_CIRC:
return process_accent(PG_ACIR, PG_A, record);
case O_CIRC:
return process_accent(PG_ACIR, PG_O, record);
case U_CIRC:
return process_accent(PG_ACIR, PG_L, record);
case I_TREM:
return process_accent(PG_NREM, PG_I, record);
}
store_keycode(next_keycode, record);
}
return true; // Process all other keycodes normally
}

View file

@ -71,10 +71,6 @@ bool process_macros(uint16_t keycode, keyrecord_t *record) {
is_apos_dr = !is_apos_dr;
return false;
case NUM_ODK:
tap_code(PG_ODK);
return true;
case PG_DEG:
tap_code(PG_ODK);
tap_code(KC_9);

View file

@ -1,122 +0,0 @@
/* Copyright 2025 @Kawamashi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "numword.h"
//static uint16_t num_word_timer = 0;
//static bool is_num_word_on = false;
bool is_num_word_on = false;
static bool exit_num_word = false;
bool is_num_word_enabled(void) {
return is_num_word_on;
}
void enable_num_word(void) {
//if (is_num_word_on) return;
is_num_word_on = true;
layer_on(_NUMBERS);
}
void disable_num_word(void) {
//if (!is_num_word_on) return;
is_num_word_on = false;
layer_off(_NUMBERS);
exit_num_word = false;
}
void toggle_num_word(void) {
if (is_num_word_on) {
disable_num_word();
} else {
enable_num_word();
}
}
bool should_exit_num_word(uint16_t keycode, const keyrecord_t *record) {
switch (keycode) {
// Keycodes which should not disable num word mode.
// Numpad keycodes
case KC_1 ... KC_0:
case KC_PDOT:
//case PG_X:
//case PG_EACU:
case PG_MOIN:
case PG_ASTX:
case PG_PLUS:
case PG_SLSH:
case PG_EXP:
case PG_IND:
case PG_H:
case PG_2PTS:
case LT_EURO:
case NNB_SPC:
// Misc
case KC_BSPC:
case PG_ODK: // Not to exit Numword when chording it with ODK
case NUMWORD: // For the combo NUMWORD to work
/*
case PG_EGAL:
case PG_BSLS:*/
return false;
}
return true;
}
bool process_numword(uint16_t keycode, const keyrecord_t *record) {
// Handle the custom keycodes that go with this feature
if (keycode == NUMWORD) {
if (record->event.pressed) { toggle_num_word(); }
return false;
}
// Other than the custom keycodes, nothing else in this feature will activate
// if the behavior is not on, so allow QMK to handle the event as usual.
if (!is_num_word_on) { return true; }
// Nothing else acts on key release, either
if (!record->event.pressed) { return true; }
// Get the base keycode of a mod or layer tap key
switch (keycode) {
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
// Earlier return if this has not been considered tapped yet
if (record->tap.count == 0) { return true; }
keycode = keycode & 0xFF;
break;
/* case QK_LAYER_TAP ... QK_LAYER_TAP_MAX: // `LT(layer, key)` keys.
// Release event on a held layer-tap key when numword is on.
if (record->tap.count == 0 && !record->event.pressed) {
return false; // Skip default handling so that layer stays on.
} else {
keycode = keycode & 0xFF; // Get tapping keycode.
}
break; */
}
exit_num_word = should_exit_num_word(keycode, record);
return true;
}
void numword_exit_check(void) {
if (exit_num_word) { disable_num_word(); }
}

View file

@ -46,43 +46,6 @@ void toggle_num_word(void) {
}
}
bool should_exit_num_word(uint16_t keycode, const keyrecord_t *record) {
switch (keycode) {
// Keycodes which should not disable num word mode.
// Numpad keycodes
case KC_1 ... KC_0:
case KC_PDOT:
//case PG_X:
//case PG_EACU:
case PG_MOIN:
case PG_ASTX:
case PG_PLUS:
case PG_SLSH:
case PG_EGAL:
case PG_EXP:
case PG_IND:
case PG_H:
case PG_2PTS:
//case PG_EURO:
//case LT_NBSPC:
case NNB_SPC:
// Misc
case KC_BSPC:
case PG_ODK: // Not to exit Numword when chording it with ODK
//case NUMWORD: // For the combo NUMWORD to work
/*
case PG_BSLS:*/
return false;
}
return true;
}
bool process_numword(uint16_t keycode, const keyrecord_t *record) {
// Handle the custom keycodes that go with this feature
@ -94,7 +57,7 @@ bool process_numword(uint16_t keycode, const keyrecord_t *record) {
// Other than the custom keycodes, nothing else in this feature will activate
// if the behavior is not on, so allow QMK to handle the event as usual.
if (!is_num_word_on) { return true; }
// Nothing else acts on key release, either
if (record->event.pressed) {
// Get the base keycode of a mod or layer tap key

View file

@ -19,7 +19,6 @@
#include "keymap.h"
bool is_num_word_enabled(void);
//extern bool exit_num_word;
extern bool is_num_word_on;
void enable_num_word(void);

View file

@ -34,6 +34,11 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
} else if (keycode == PG_ODK) {
invoke_odk = true;
//return deferred_shift_after_dead_key(keycode, mods);
} else if (keycode == NUM_ODK) {
invoke_odk = true;
//return deferred_shift_after_dead_key(keycode, mods);
} else if (IS_LAYER_ON(_ODK)) {
switch (keycode) {
@ -49,6 +54,7 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
default:
invoke_odk = true;
//return deferred_shift_after_dead_key(keycode, mods);
}
}
@ -69,10 +75,26 @@ bool process_odk_layer(uint16_t keycode, keyrecord_t *record) {
if (is_shifted) {
set_oneshot_mods(MOD_BIT(KC_LSFT)); // Don't use weak mods!
//is_shifted = false;
}
if (keycode == PG_ODK) { return false; }
}
}
return true;
}
bool deferred_shift_after_dead_key(uint16_t keycode, uint8_t mods) {
bool is_shifted = false;
if (mods & MOD_MASK_SHIFT) {
del_weak_mods(MOD_MASK_SHIFT);
del_oneshot_mods(MOD_MASK_SHIFT);
unregister_mods(MOD_MASK_SHIFT);
is_shifted = true;
}
tap_code(PG_ODK);
if (is_shifted) { set_oneshot_mods(MOD_BIT(KC_LSFT)); } // Don't use weak mods!
return !(keycode == PG_ODK);
}

View file

@ -25,6 +25,7 @@ extern "C" {
#endif
bool process_odk_layer(uint16_t keycode, keyrecord_t *record);
bool deferred_shift_after_dead_key(uint16_t keycode, uint8_t mods);
#ifdef __cplusplus
}

View file

@ -62,7 +62,7 @@ bool os4a_layer_process_outcome(uint16_t keycode, keyrecord_t *record) {
// Should keycode exit the OS4A layer without further process ?
if (should_exit_os4a_layer(keycode)) { return true; }
// Should keycode stay on the OS4A layer, e.g. Callum mod?
// Should keycode stay on the OS4A layer, to be possibly combined with another one, e.g. Callum mod?
if (is_oneshot_ignored_key(keycode)) { return false; }
// Add OS Shift when no other mods are active.
@ -70,8 +70,8 @@ bool os4a_layer_process_outcome(uint16_t keycode, keyrecord_t *record) {
// to be processed (ex: custom altgr, clever keys).
const uint8_t mods = get_mods() | get_oneshot_mods();
if (!exit_os4a_layer && to_be_shifted(keycode, record) && mods == 0) {
// Don't use weak mods, it interferes with Capsword.
set_oneshot_mods(MOD_BIT(KC_LSFT));
// Don't use weak mods, it interferes with Capsword.
}
return true;
}
@ -94,8 +94,8 @@ bool process_mods(uint16_t keycode, keyrecord_t *record) {
update_oneshot(&os_shft_state, KC_LSFT, OS_SHFT, keycode, record);
update_oneshot(&os_ctrl_state, KC_LCTL, OS_CTRL, keycode, record);
update_oneshot(&os_alt_state, KC_LALT, OS_LALT, keycode, record);
update_oneshot(&os_altgr_state, KC_RALT, OS_RALT, keycode, record);
update_oneshot(&os_win_state, KC_LWIN, OS_WIN, keycode, record);
//update_oneshot(&os_altgr_state, KC_RALT, OS_RALT, keycode, record);
// Handling OS4A keys
if (IS_OS4A_KEY(keycode)) { return process_os4a_keys(keycode, record); }

View file

@ -26,8 +26,7 @@ void tap_converter(uint16_t keycode, keyrecord_t *record) {
} else {
if (IS_QK_MOD_TAP(keycode) || IS_QK_LAYER_TAP(keycode)) {
// Tranform the record to send the tap event
//record->keycode = tap_hold_extractor(keycode);
record->keycode = (keycode &= 0xff);
record->keycode = tap_hold_extractor(keycode);
}
process_record(record);
}

View file

@ -16,54 +16,9 @@
#include "features_conf.h"
bool is_caps_lock_on(void) { return host_keyboard_led_state().caps_lock; }
bool is_letter(uint16_t keycode) {
switch (keycode) {
case KC_A ... KC_F:
case KC_H ... KC_P:
case KC_R ... KC_S:
case KC_U ... KC_Z:
case PG_L:
case PG_E:
case KC_GRV ... KC_DOT:
return true;
default:
return false;
}
}
bool is_send_string_macro(uint16_t keycode) {
switch (keycode) {
case OU_GRV:
case MAGIC:
//case PG_DEG:
return true;
default:
return false;
}
}
bool is_followed_by_apos(uint16_t keycode, uint16_t prev_keycode) {
switch (keycode) {
case PG_Q:
return true;
case PG_L:
case PG_T:
case PG_D:
case PG_C:
case PG_N:
case PG_S:
case PG_M:
case PG_Y:
case PG_J:
if (!is_letter(prev_keycode)) { return true; }
}
return false;
}
// This function extracts the base keycode of MT and LT,
// even if the tap/hold key is a custom one, with non-basic tap keycode.
@ -103,68 +58,6 @@ bool process_custom_tap_hold(uint16_t keycode, keyrecord_t *record) {
}
// Caps Word
bool caps_word_press_user(uint16_t keycode) {
// Caps Word shouldn't be applied with Alt-gr
// Managing underscore and slash on alt gr + E/T.
// Underscore and slash must continue Caps Word, without shifting.
/* if ((get_mods() & MOD_BIT(KC_ALGR))) {
switch (keycode) {
case PG_E:
case PG_T:
return true;
default:
return false;
}
} */
if (IS_LAYER_ON(_ODK)) {
switch (keycode) {
case PG_VIRG:
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true;
case PG_Y:
case PG_T:
return true;
case PG_POIN:
return false;
}
}
// Keycodes that continue Caps Word, with shift applied.
// @ must be shifted, bc of CleverKeys using it.
if (is_letter(keycode) || is_send_string_macro(keycode) || keycode == PG_AROB) {
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true;
}
switch (keycode) {
// Keycodes that continue Caps Word, without shifting.
case PG_ODK:
//case PG_GRV:
case PG_UNDS:
case PG_TIRE:
case PG_SLSH:
case KC_1 ... KC_0:
//case KC_LEFT:
//case KC_RIGHT:
case KC_BSPC:
case LCTL(KC_BSPC):
case KC_DEL:
case PG_APOS:
return true;
default:
return false; // Deactivate Caps Word.
}
}
// Clever keys configuration
uint16_t get_ongoing_keycode_user(uint16_t keycode) {
@ -176,9 +69,7 @@ uint16_t get_ongoing_keycode_user(uint16_t keycode) {
switch (keycode) {
case PG_K:
case PG_B:
case PG_AROB:
//case PG_3PTS:
case KC_SPC: // In order to uppercase J after '?' for ex.
case KC_SPC: // When space is added by clever keys, for ex. in order to uppercase K after '?' for ex.
return keycode;
case PG_POIN:
@ -192,6 +83,7 @@ uint16_t get_ongoing_keycode_user(uint16_t keycode) {
return KC_TRNS;
}
// One-shot 4 all configuration
uint8_t get_os4a_layer(uint16_t keycode) {
@ -220,8 +112,6 @@ bool to_be_shifted(uint16_t keycode, keyrecord_t *record) {
if (!IS_KEYEVENT(record->event)) { return true; }
switch (keycode) {
/* case OS_ODK:
is_shifted = true; */
case KC_CAPS:
case CAPSWORD:
case CAPSLIST:

View file

@ -20,9 +20,6 @@
#include "keymap.h"
bool is_caps_lock_on(void);
bool is_letter(uint16_t keycode);
bool is_send_string_macro(uint16_t keycode);
bool is_followed_by_apos(uint16_t keycode, uint16_t prev_keycode);
uint16_t tap_hold_extractor(uint16_t keycode);
bool process_custom_tap_hold(uint16_t keycode, keyrecord_t *record);

View file

@ -126,7 +126,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* Base Layer: ALPHAS
*»\
* ,-------------------------------------------. ,-------------------------------------------.
* | | X | È | É | . | K | | V | B | L | M | X | |
* | | À | È | É | . | K | | V | B | L | M | X | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | Enter | O | U | A | I | J | | G | T | S | N | R | F |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
@ -185,28 +185,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, _______, KC_CAPS, _______, MAGIC, TG_APOS, _______, _______, KC_NO, KC_NO
),
/*
* Layer : Symbols
*
* ,-------------------------------------------. ,-------------------------------------------.
* | | ^ | { | } | $ | # | | % | " | = | ! | ` | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | ? | ( | ) | ; | : | | \ | / | - | + | * | |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | | < | [ | ] | > | | | | | | | | ' | & | | | ~ | |
* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_SYMBOLS] = LAYOUT(
_______, PG_ACIR, PG_LCBR, PG_RCBR, PG_DLR, PG_PERC, PG_HASH, PG_DQUO, PG_EGAL, ALGR(PG_J), PG_GRV, _______,
_______, ALGR(PG_O), PG_LPRN, PG_RPRN, PG_PVIR, PG_2PTS, PG_BSLS, MT_SLSH, PG_MOIN, PG_PLUS, PG_ASTX, _______,
_______, PG_INF, PG_LSBR, PG_RSBR, PG_SUP, _______, _______, _______, _______, _______, _______, PG_APOD, PG_ESPR, PG_PIPE, PG_TILD, _______,
_______, _______, _______, PG_UNDS, KC_SPC, _______, _______, _______, _______, _______
),
/*
* Layer 1 : Numpad
@ -227,9 +205,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
_______, PG_DLR, PG_MOIN, PG_PLUS, PG_EURO, PG_PERC, PG_EXP, S(PG_EGAL), PG_EGAL, PG_ASTX, _______, _______,
_______, KC_4, KC_3, KC_2, MT_1, PG_2PTS, PG_IND, MT_SLSH, KC_6, KC_7, KC_8, _______,
_______, S(KC_4), S(KC_3), PG_H, KC_5, _______, _______, _______, _______, _______, _______, KC_9, PG_DEG, _______, PG_ODK, _______,
_______, _______, KC_PDOT, KC_0 , LT_NBSPC, _______, KC_SPC, _______, _______, _______
_______, _______, KC_PDOT, LT_0 , LT_NBSPC, _______, KC_SPC, _______, _______, _______
),
/*
* Layer : Symbols
*
* ,-------------------------------------------. ,-------------------------------------------.
* | | ^ | { | } | $ | # | | % | " | = | ! | ` | |
* |--------+------+------+------+------+------| |------+------+------+------+------+--------|
* | | ? | ( | ) | ; | : | | \ | / | - | + | * | |
* |--------+------+------+------+------+------+-------------. ,-------------+------+------+------+------+------+--------|
* | | < | [ | ] | > | | | | | | | | ' | & | | | ~ | |
* `----------------------+------+------+------+------+------| |------+------+------+------+------+----------------------'
* | | | | | | | | | | | |
* | | | | | | | | | | | |
* `----------------------------------' `----------------------------------'
*/
[_SYMBOLS] = LAYOUT(
_______, PG_ACIR, PG_LCBR, PG_RCBR, PG_DLR, PG_PERC, PG_HASH, PG_DQUO, PG_EGAL, ALGR(PG_J), PG_GRV, _______,
_______, ALGR(PG_O), PG_LPRN, PG_RPRN, PG_PVIR, PG_2PTS, PG_BSLS, MT_SLSH, PG_MOIN, PG_PLUS, PG_ASTX, _______,
_______, PG_INF, PG_LSBR, PG_RSBR, PG_SUP, _______, _______, _______, _______, _______, _______, PG_APOD, PG_ESPR, PG_PIPE, PG_TILD, _______,
_______, _______, _______, PG_UNDS, KC_SPC, _______, _______, _______, _______, _______
),
/*
* Layer 2 : Symbols

View file

@ -20,6 +20,7 @@
#include "keymap_french_propergol.h"
#include "features_conf.h"
#include "word_conf.h"
#include "clever_keys.h"
#include "features/tap_hold_utilities.h"
#include "features/clever_keys_utilities.h"
@ -37,8 +38,8 @@ enum layers {
_L_MODS,
_R_MODS,
_ODK,
_SYMBOLS,
_NUMBERS,
_SYMBOLS,
_SHORTNAV,
_FUNCAPPS,
};
@ -73,6 +74,7 @@ enum custom_keycodes {
#define TG_FA TT(_FUNCAPPS)
#define MT_SLSH SFT_T(PG_SLSH)
#define MT_1 SFT_T(KC_1)
#define LT_0 LT(_SYMBOLS, KC_0)
#define LT_NBSPC LT(_SHORTNAV, NNB_SPC)
#define E_CIRC S(FG_0)
#define OS_ODK OSL(_ODK)

View file

@ -36,6 +36,7 @@ SRC += features/capslist.c
SRC += features/macros.c
SRC += features/oneshot.c
SRC += features_conf.c
SRC += word_conf.c
SRC += features/odk_layer.c
INTROSPECTION_KEYMAP_C = features/combos.c

View file

@ -0,0 +1,193 @@
/* Copyright 2025 @Kawamashi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "word_conf.h"
bool is_letter(uint16_t keycode) {
switch (keycode) {
case KC_A ... KC_F:
case KC_H ... KC_P:
case KC_R ... KC_S:
case KC_U ... KC_Z:
case PG_L:
case PG_E:
case KC_GRV ... KC_DOT:
return true;
default:
return false;
}
}
bool is_send_string_macro(uint16_t keycode) {
switch (keycode) {
case OU_GRV:
case MAGIC:
case PG_AROB: // because of Clever Keys
return true;
default:
return false;
}
}
bool is_followed_by_apos(uint16_t keycode, uint16_t prev_keycode) {
switch (keycode) {
case PG_Q:
return true;
case PG_L:
case PG_T:
case PG_D:
case PG_C:
case PG_N:
case PG_S:
case PG_M:
case PG_Y:
case PG_J:
if (!is_letter(prev_keycode)) { return true; }
}
return false;
}
// Caps Word
bool caps_word_press_user(uint16_t keycode) {
if (IS_LAYER_ON(_ODK)) {
switch (keycode) {
case PG_VIRG:
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true;
case PG_Y: // pour le tréma
case PG_T: // pour le trait dunion insécable
return true;
}
}
// Keycodes that continue Caps Word, with shift applied.
// @ must be shifted, bc of CleverKeys using it.
if (is_letter(keycode) || is_send_string_macro(keycode)) {
add_weak_mods(MOD_BIT(KC_LSFT)); // Apply shift to next key.
return true;
}
switch (keycode) {
// Keycodes that continue Caps Word, without shifting.
case PG_ODK:
case PG_UNDS:
case PG_TIRE:
case PG_SLSH:
case KC_1 ... KC_0:
//case KC_LEFT:
//case KC_RIGHT:
case KC_BSPC:
case LCTL(KC_BSPC):
case KC_DEL:
case PG_APOS:
return true;
default:
return false; // Deactivate Caps Word.
}
}
// Num Word
bool should_exit_num_word(uint16_t keycode, const keyrecord_t *record) {
switch (keycode) {
// Keycodes which should not disable num word mode.
// Numpad keycodes
case KC_1 ... KC_0:
case KC_PDOT:
case PG_MOIN:
case PG_ASTX:
case PG_PLUS:
case PG_SLSH:
case PG_EGAL:
case PG_EXP:
case PG_IND:
case PG_H:
case PG_2PTS:
case NNB_SPC:
// Misc
case KC_BSPC:
case PG_ODK: // Not to exit Numword when chording it with ODK
//case NUMWORD: // For the combo NUMWORD to work
return false;
}
return true;
}
// Caps List
bool should_continue_caps_list(uint16_t keycode) {
if (keycode == KC_BSPC) {
capslist_countdown--;
return true;
}
if (is_letter(keycode) || is_send_string_macro(keycode)) {
capslist_countdown++;
return true;
}
if (caps_word_press_user(keycode)) {
// This condition can't be merged with the previous one
// because caps_word_press_user adds shift to letters and send-string macros.
capslist_countdown++;
return true;
}
// Keycodes that continue Caps List, but not Caps Word.
// These keycodes trigger the countdown to end Caps List.
switch (keycode) {
case PG_VIRG:
case KC_SPC:
capslist_countdown++;
return true;
}
return false; // Deactivate Caps List.
}
bool caps_word_reactivation(void) {
// Words that continue Caps List.
if (recent[RECENT_SIZE - 1] == KC_SPC) {
if (recent[RECENT_SIZE - 4] == KC_SPC && recent[RECENT_SIZE - 3] == PG_E && recent[RECENT_SIZE - 2] == PG_T) {
countdown_end = 1;
return true;
}
if (recent[RECENT_SIZE - 4] == KC_SPC && recent[RECENT_SIZE - 3] == PG_O && recent[RECENT_SIZE - 2] == PG_U) {
countdown_end = 1;
return true;
}
if (recent[RECENT_SIZE - 2] == PG_VIRG) {
return true;
}
}
return false;
}

View file

@ -0,0 +1,27 @@
/* Copyright 2025 @Kawamashi
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "quantum.h"
#include "keymap.h"
bool is_letter(uint16_t keycode);
bool is_send_string_macro(uint16_t keycode);
bool is_followed_by_apos(uint16_t keycode, uint16_t prev_keycode);
bool should_exit_num_word(uint16_t keycode, const keyrecord_t *record);