~ruther/qmk_firmware

cc9d0ded3d1d59b27d1ae49946d2be484c1041e7 — Rutherther 6 months ago ee832e6
feat: caps word modifications

* caps word: Disable caps word on ESC press
* caps word: Do not convert minus to underscore
* caps word: Invert on shift
M keyboards/splitkb/kyria/keymaps/rutherther/config.h => keyboards/splitkb/kyria/keymaps/rutherther/config.h +1 -0
@@ 23,5 23,6 @@
#define QUICK_TAP_TERM 0

#define BOTH_SHIFTS_TURNS_ON_CAPS_WORD
#define CAPS_WORD_INVERT_ON_SHIFT

/* #define ACHORDION_STREAK */

M keyboards/splitkb/kyria/keymaps/rutherther/keymap.c => keyboards/splitkb/kyria/keymaps/rutherther/keymap.c +32 -1
@@ 3,6 3,8 @@
#include "features/cz_accent.h"
#include "features/achordion.h"

bool process_caps_word_off(uint16_t keycode, keyrecord_t* record);

enum layers {
  _QWERTY = 0,
  _QWERTY_NOHOMEMODS,


@@ 177,7 179,7 @@ void keyboard_pre_init_user(void) {

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  static bool achordion = true;

  if (!process_caps_word_off(keycode, record)) { return false; }
  if (!process_czech_acute(keycode, record, CZ_ACUTED, _PLAIN)) { return false; }
  if (!process_czech_caret(keycode, record, CZ_CARETED, _PLAIN)) { return false; }
  if (!process_layer_lock(keycode, record, QK_LLCK)) { return false; }


@@ 199,6 201,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  return true;
}

bool process_caps_word_off(uint16_t keycode, keyrecord_t* record)
{
  if (is_caps_word_on() && keycode == KC_ESC) {
    caps_word_off();
    return false;
  }

  return true;
}

bool achordion_chord(uint16_t tap_hold_keycode,
                      keyrecord_t* tap_hold_record,
                      uint16_t other_keycode,


@@ 232,6 244,25 @@ bool achordion_eager_mod(uint8_t mod) {
  }
}

bool caps_word_press_user(uint16_t keycode) {
    switch (keycode) {
        // Keycodes that continue Caps Word, with shift applied.
        case KC_A ... KC_Z:
            add_weak_mods(MOD_BIT(KC_LSFT));  // Apply shift to next key.
            return true;

        // Keycodes that continue Caps Word, without shifting.
        case KC_1 ... KC_0:
        case KC_BSPC:
        case KC_DEL:
        case KC_UNDS:
        case KC_MINS:
            return true;
        default:
            return false;  // Deactivate Caps Word.
    }
}

/*
qmk-keyboard-format:json:begin
{

Do not follow this link