diff options
Diffstat (limited to 'qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c')
| -rw-r--r-- | qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c b/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c index c21ba53..e82eed5 100644 --- a/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c +++ b/qmk/keyboards/sofle_choc/keymaps/custom/keycodes.c @@ -6,7 +6,7 @@ * Rules and modifier to apply over the keycodes. This includes the keys * redefinitions and the keys to include in the caps_word mecanism. * - * All thoses update are working over the custom keys declared in `keycodes.h` + * All thoses update are working over the custom keys declared in `keycodes.h` */ /* @@ -20,7 +20,6 @@ bool caps_word_press_user(uint16_t keycode) { case KC_A ... KC_Z: case KC_1 ... KC_0: case KC_MINS: - case KEY_C: // Add also the tapdance keys here. case KEY_W: case KEY_E: case BP_Z: // Additionals keys from the bepo layout. @@ -51,9 +50,8 @@ uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) { case KEY_E: return 230; case KEY_W: - return 400; - case KEY_EE: - return 350; + case TD_ENTER: + return 2 * TAPPING_TERM; default: return TAPPING_TERM; } @@ -64,7 +62,7 @@ static uint32_t key_timer; // timer for last keyboard activity, use // idle time possible static uint16_t latest_key = 0L; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool keycodes_process_record(uint16_t keycode, keyrecord_t *record) { if (!record->event.pressed) { @@ -72,14 +70,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // know if we are inside a typing sequence or not. key_timer = timer_read32(); latest_key = keycode; - } + } switch (keycode) { - case KC_LEFT_SHIFT: - if (host_keyboard_led_state().caps_lock) { - tap_code16(KC_CAPS_LOCK); - } - return true; + case KC_ESC: case AL_ENT: if (layer_state_is(LAYER_SYMBOLS) && !record->event.pressed) { // Remove the layer the key is released. @@ -87,7 +81,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; // If a key where released just before, consider we are typing some text - // and not starting a new sequence + // and not starting a new sequence case KEY_E: if (record->event.pressed && timer_elapsed32(key_timer) < TAPPING_TERM) { if (is_caps_word_on()) { @@ -106,19 +100,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; } return true; - // Here, the key KC_BSPC become È when used inside a sequence, but we still - // allow the repetition of KC_BSPC. - case KC_BSPC: - if (record->event.pressed \ - && timer_elapsed32(key_timer) < (TAPPING_TERM / 2) \ - && latest_key != keycode) - { - // I completely rewrite the key here, that’s why I’m using tap_code16 - // instead of register_code. - tap_code16(BP_EGRV); - return false; - } - return true; // Override the key APP when hold into AltGR + Layer 1 when hold case KEY_APP: @@ -140,7 +121,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(1); } return true; + default: return true; // Process all other keycodes normally } } + |
