aboutsummaryrefslogtreecommitdiff
path: root/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2024-04-12 22:44:05 +0200
committerSébastien Dailly <sebastien@dailly.me>2024-04-12 22:44:05 +0200
commit265fd6478f634895cb22488c42aa9eab50788cd8 (patch)
treec630060e8227770190d05d6139d5892bffc83473 /qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c
parentf8363576f7eaf92c9e4c3a6e9323fa2535eb4c88 (diff)
Update qmk
Diffstat (limited to 'qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c')
-rw-r--r--qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c b/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c
index 761e653..d3cb716 100644
--- a/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c
+++ b/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c
@@ -50,8 +50,8 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case KEY_E:
return 230;
- case LT_SFT:
- return 250;
+ case KEY_W:
+ return 300;
case KEY_EE:
return 350;
default:
@@ -75,22 +75,33 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
switch (keycode) {
+ case KC_LEFT_SHIFT:
+ if (host_keyboard_led_state().caps_lock) {
+ tap_code16(KC_CAPS_LOCK);
+ }
+ return true;
case AL_ENT:
if (layer_state_is(LAYER_SYMBOLS) && !record->event.pressed) {
// Remove the layer the key is released.
layer_clear();
}
- return true; // Let QMK send the enter press/release events
+ return true;
// If a key where released just before, consider we are typing some text
// and not starting a new sequence
case KEY_E:
if (record->event.pressed && timer_elapsed32(key_timer) < TAPPING_TERM) {
+ if (is_caps_word_on()) {
+ add_oneshot_mods(MOD_MASK_SHIFT);
+ }
register_code(BP_E);
return false;
}
return true;
case KEY_T:
if (record->event.pressed && timer_elapsed32(key_timer) < TAPPING_TERM) {
+ if (is_caps_word_on()) {
+ add_oneshot_mods(MOD_MASK_SHIFT);
+ }
register_code(BP_T);
return false;
}
@@ -108,6 +119,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false;
}
return true;
+
+ // Override the key APP when hold into AltGR + Layer 1 when hold
+ case KEY_APP:
+ if (!record->tap.count && record->event.pressed) {
+ layer_on(1);
+ register_code(KC_RIGHT_ALT);
+ return false;
+ } else if (!record->tap.count && !record->event.pressed) {
+ unregister_code(KC_RIGHT_ALT);
+ layer_off(1);
+ return false;
+ }
+
+ case KC_LGUI:
+ if (record->event.pressed) {
+ layer_on(1);
+ }
+ else {
+ layer_off(1);
+ }
+ return true;
default:
return true; // Process all other keycodes normally
}