Skip to content

Commit

Permalink
Deprecate CAPS_WORD/CAPSWRD for CW_TOGG (qmk#18834)
Browse files Browse the repository at this point in the history
  • Loading branch information
fauxpark authored and ramonimbao committed Nov 28, 2022
1 parent 5f24275 commit f4caf9a
Show file tree
Hide file tree
Showing 19 changed files with 31 additions and 34 deletions.
4 changes: 2 additions & 2 deletions docs/feature_caps_word.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ CAPS_WORD_ENABLE = yes

Next, use one the following methods to activate Caps Word:

* **Activate by pressing a key**: Use the `CAPS_WORD` keycode (short
alias `CAPSWRD`) in your keymap.
* **Activate by pressing a key**: Use the `QK_CAPS_WORD_TOGGLE` keycode (short
alias `CW_TOGG`) in your keymap.

* **Activate by pressing Left Shift + Right Shift**: Add `#define
BOTH_SHIFTS_TURNS_ON_CAPS_WORD` to config.h. You may also need to disable or
Expand Down
6 changes: 3 additions & 3 deletions docs/keycodes.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,9 @@ See also: [Bluetooth](feature_bluetooth.md)

See also: [Caps Word](feature_caps_word.md)

|Key |Aliases |Description |
|-----------|---------|------------------------------|
|`CAPS_WORD`|`CAPSWRD`|Toggles Caps Word |
|Key |Aliases |Description |
|---------------------|---------|------------------------------|
|`QK_CAPS_WORD_TOGGLE`|`CW_TOGG`|Toggles Caps Word |

## Dynamic Macros :id=dynamic-macros

Expand Down
2 changes: 1 addition & 1 deletion keyboards/bastardkb/dilemma/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
NAV, CAPSWRD, KC_SPC, SYM
NAV, CW_TOGG, KC_SPC, SYM
// ╰──────────────────╯ ╰──────────────────╯
),

Expand Down
6 changes: 3 additions & 3 deletions keyboards/handwired/hillside/46/keymaps/default/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN", "KC_ENT",

"KC_LCTL" , "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_ESC",
"ANY(CAPSWRD)", "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_QUOT",
"ANY(CW_TOGG)", "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_QUOT",

"KC_LGUI" , "KC_LALT" , "OSM(MOD_LSFT)", "MO(3)",
"MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI"
Expand All @@ -25,7 +25,7 @@
"KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_ENT",

"KC_LCTL" , "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_ESC",
"ANY(CAPSWRD)", "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_SLSH",
"ANY(CW_TOGG)", "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_SLSH",

"KC_LGUI" , "KC_LALT" , "OSM(MOD_LSFT)", "MO(3)",
"MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI"
Expand All @@ -38,7 +38,7 @@
"KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_ENT",

"KC_LCTL" , "KC_Z" , "KC_TRNS" , "KC_C" , "KC_D" , "KC_V" , "KC_ESC",
"ANY(CAPSWRD)", "KC_K" , "KC_H" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_QUOT",
"ANY(CW_TOGG)", "KC_K" , "KC_H" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_QUOT",

"KC_LGUI" , "KC_LALT" , "OSM(MOD_LSFT)", "MO(3)",
"MO(4)" , "KC_SPC" , "KC_LALT" , "KC_RGUI"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, CAPSWRD, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, CW_TOGG, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
KC_LGUI, KC_LALT, OSM_SFT, LY_NAV , LY_SYM , KC_SPC , KC_LALT, KC_RGUI
),
[_NAV] = LAYOUT(
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/hillside/46/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT(
KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, CAPSWRD, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, CW_TOGG, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT,
KC_LGUI, KC_LALT, OSM_SFT, LY_NAV , LY_SYM , KC_SPC , KC_LALT, KC_RGUI
),
[_NAV] = LAYOUT(
Expand Down
6 changes: 3 additions & 3 deletions keyboards/handwired/hillside/48/keymaps/default/keymap.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"KC_H" , "KC_J" , "KC_K" , "KC_L" , "KC_SCLN" , "KC_ENT",

"KC_LSFT" , "KC_Z" , "KC_X" , "KC_C" , "KC_V" , "KC_B" , "KC_ESC",
"CAPS_WORD" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_RSFT",
"CW_TOGG" , "KC_N" , "KC_M" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_RSFT",

"KC_LCTL" , "KC_LGUI" , "KC_LALT", "MO(3)" , "OSM(MOD_LSFT)",
"MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_QUOT"
Expand All @@ -25,7 +25,7 @@
"KC_D" , "KC_H" , "KC_T" , "KC_N" , "KC_S" , "KC_ENT",

"KC_LSFT" , "KC_SCLN" , "KC_Q" , "KC_J" , "KC_K" , "KC_X" , "KC_ESC",
"CAPS_WORD" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT",
"CW_TOGG" , "KC_B" , "KC_M" , "KC_W" , "KC_V" , "KC_Z" , "KC_RSFT",

"KC_LCTL" , "KC_LGUI" , "KC_LALT", "MO(3)" , "OSM(MOD_LSFT)",
"MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_SLSH"
Expand All @@ -38,7 +38,7 @@
"KC_M" , "KC_N" , "KC_E" , "KC_I" , "KC_O" , "KC_ENT",

"KC_LSFT" , "KC_Z" , "KC_X" , "KC_C" , "KC_D" , "KC_V" , "KC_ESC",
"CAPS_WORD" , "KC_K" , "KC_H" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_RSFT",
"CW_TOGG" , "KC_K" , "KC_H" , "KC_COMM", "KC_DOT" , "KC_SLSH" , "KC_RSFT",

"KC_LCTL" , "KC_LGUI" , "KC_LALT", "MO(3)" , "OSM(MOD_LSFT)",
"MO(4)" , "KC_SPC" , "KC_LALT", "KC_RGUI", "KC_QUOT"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
["KC_INS" , "KC_EXLM" , "KC_AT" , "KC_HASH", "KC_DLR" , "KC_PERC",
"KC_CIRC" , "KC_AMPR" , "KC_ASTR", "KC_LPRN", "KC_RPRN", "KC_DEL",

"ANY(CAPSWRD)", "KC_BSLS" , "KC_MINS", "KC_EQL" , "KC_LBRC", "KC_RBRC",
"ANY(CW_TOGG)", "KC_BSLS" , "KC_MINS", "KC_EQL" , "KC_LBRC", "KC_RBRC",
"KC_VOLU" , "KC_RSFT" , "KC_RCTL", "KC_LALT", "KC_RGUI", "KC_TRNS",

"KC_TRNS" , "KC_PIPE" , "KC_UNDS", "KC_PLUS", "KC_LCBR", "KC_RCBR" , "KC_MPLY",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
[_SYM] = LAYOUT(
KC_INS, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
CAPSWRD, KC_BSLS, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_VOLU, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, _______,
CW_TOGG, KC_BSLS, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_VOLU, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, _______,
_______, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_MPLY, KC_MUTE, KC_VOLD, KC_0 , KC_1 , KC_2 , xxxxxxx, _______,
xxxxxxx, xxxxxxx, _______, _______, _______, _______, LY_ADJ , _______, _______, _______, _______, KC_RCTL, KC_APP, ALT_GR
),
Expand Down
2 changes: 1 addition & 1 deletion keyboards/handwired/hillside/52/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
),
[_SYM] = LAYOUT(
KC_INS, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL,
CAPSWRD, KC_BSLS, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_VOLU, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, _______,
CW_TOGG, KC_BSLS, KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_VOLU, KC_RSFT, KC_RCTL, KC_LALT, KC_RGUI, _______,
_______, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_MPLY, KC_MUTE, KC_VOLD, KC_0 , KC_1 , KC_2 , xxxxxxx, _______,
xxxxxxx, xxxxxxx, _______, _______, _______, _______, LY_ADJ , _______, _______, _______, _______, KC_RCTL, KC_APP, ALT_GR
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ _______ ,_______ ,RALT_T(KC_S),LCTL_T(KC_D),LSFT_T(KC_F),LT(_SYM,KC_G),_______ ,
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_LPRN ,KC_RPRN ,XXXXXXX ,
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
CAPSWRD ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,_______ , _______ ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_QUOT ,
CW_TOGG ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,_______ , _______ ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_QUOT ,
// ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤
_______ ,KC_MSEL ,KC_MPLY ,XXXXXXX ,KC_EQL ,KC_PLUS ,_______ , _______ ,KC_UNDS ,KC_MINS , KC_MPRV, KC_MNXT,KC_MPLY ,_______ ,
// ├────────┼────────┼────────┴─┬──────┴───┬────┴────────┼────────┤ ├────────┼────────┴────┬───┴──────┬─┴────────┼────────┼────────┤
Expand Down
2 changes: 1 addition & 1 deletion keyboards/planck/keymaps/muppetjones/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
[_CLMK_DH] = LAYOUT_planck_wrapper(
__COLEMAK_MOD_DH_L1________________________, KC_DEL, KC_BSPC, __COLEMAK_MOD_DH_R1_W_QUOT_________________,
__COLEMAK_MOD_DH_L2_W_GACS_________________, CAPSWRD, KC_QUOT, __COLEMAK_MOD_DH_R2_W_SCAG_________________,
__COLEMAK_MOD_DH_L2_W_GACS_________________, CW_TOGG, KC_QUOT, __COLEMAK_MOD_DH_R2_W_SCAG_________________,
__COLEMAK_MOD_DH_L3_W_SFTV_________________, KC_ENT, KC_TAB, __COLEMAK_MOD_DH_R3________________________,
TD_LAYR, XXXXXXX, XXXXXXX, HY_ESC, LOW_ENT, KC_BSPC, KC_BSPC, RAI_SPC, HY_ESC, KC_BSPC, XXXXXXX, XXXXXXX
),
Expand Down
2 changes: 1 addition & 1 deletion keyboards/splitkb/kyria/keymaps/muppetjones/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `----------------------------------' `----------------------------------'
*/
[_CLMK_DH] = LAYOUT_wrapper(
CAPSWRD, __COLEMAK_MOD_DH_L1________________________, __COLEMAK_MOD_DH_R1_W_QUOT_________________, KC_BSLS,
CW_TOGG, __COLEMAK_MOD_DH_L1________________________, __COLEMAK_MOD_DH_R1_W_QUOT_________________, KC_BSLS,
HY_ESC, __COLEMAK_MOD_DH_L2_W_GACS_________________, __COLEMAK_MOD_DH_R2_W_SCAG_________________, KC_QUOT,
TD_LAYR, __COLEMAK_MOD_DH_L3________________________, KC_LSFT, QK_LEAD, KC_DEL, KC_TAB, __COLEMAK_MOD_DH_R3________________________, KC_SFTENT,
KC_MUTE, KC_DEL, HY_ESC, LOW_BSP, RAI_ENT, KC_BSPC, NAV_SPC, HY_ESC, RAI_TAB, KC_RALT
Expand Down
2 changes: 1 addition & 1 deletion quantum/process_keycode/process_caps_word.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "process_caps_word.h"

bool process_caps_word(uint16_t keycode, keyrecord_t* record) {
if (keycode == CAPSWRD) { // Pressing CAPSWRD toggles Caps Word.
if (keycode == QK_CAPS_WORD_TOGGLE) {
if (record->event.pressed) {
caps_word_toggle();
}
Expand Down
7 changes: 4 additions & 3 deletions quantum/quantum_keycodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ enum quantum_keycodes {
SECURE_TOGGLE,
SECURE_REQUEST,

CAPS_WORD,
QK_CAPS_WORD_TOGGLE,

MAGIC_SWAP_ESCAPE_CAPSLOCK,
MAGIC_UNSWAP_ESCAPE_CAPSLOCK,
Expand Down Expand Up @@ -846,6 +846,9 @@ enum quantum_keycodes {
// Leader key
#define QK_LEAD QK_LEADER

// Caps Word
#define CW_TOGG QK_CAPS_WORD_TOGGLE

// Swap Hands
#define SH_T(kc) (QK_SWAP_HANDS | (kc))
#define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE)
Expand Down Expand Up @@ -952,6 +955,4 @@ enum quantum_keycodes {
#define QK_PROGRAMMABLE_BUTTON_MIN QK_PROGRAMMABLE_BUTTON_1
#define QK_PROGRAMMABLE_BUTTON_MAX QK_PROGRAMMABLE_BUTTON_32

#define CAPSWRD CAPS_WORD

#include "quantum_keycodes_legacy.h"
2 changes: 2 additions & 0 deletions quantum/quantum_keycodes_legacy.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#define KC_LOCK QK_LOCK

#define VLK_TOG QK_VELOCIKEY_TOGGLE
#define CAPSWRD QK_CAPS_WORD_TOGGLE
#define CAPS_WORD QK_CAPS_WORD_TOGGLE

#define PROGRAMMABLE_BUTTON_1 QK_PROGRAMMABLE_BUTTON_1
#define PROGRAMMABLE_BUTTON_2 QK_PROGRAMMABLE_BUTTON_2
Expand Down
8 changes: 4 additions & 4 deletions tests/caps_word/test_caps_word.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,19 @@ TEST_F(CapsWord, DefaultCapsWordPressUserFun) {
}
}

// Tests that `CAPSWRD` key toggles Caps Word.
// Tests that `QK_CAPS_WORD_TOGGLE` key toggles Caps Word.
TEST_F(CapsWord, CapswrdKey) {
TestDriver driver;
KeymapKey key_capswrd(0, 0, 0, CAPSWRD);
KeymapKey key_capswrd(0, 0, 0, QK_CAPS_WORD_TOGGLE);
set_keymap({key_capswrd});

// No keyboard reports should be sent.
EXPECT_NO_REPORT(driver);

tap_key(key_capswrd); // Tap the CAPSWRD key.
tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key.
EXPECT_EQ(is_caps_word_on(), true);

tap_key(key_capswrd); // Tap the CAPSWRD key again.
tap_key(key_capswrd); // Tap the QK_CAPS_WORD_TOGGLE key again.
EXPECT_EQ(is_caps_word_on(), false);

testing::Mock::VerifyAndClearExpectations(&driver);
Expand Down
5 changes: 0 additions & 5 deletions users/muppetjones/muppetjones.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case CAPSWRD:
if (record->event.pressed) {
toggle_caps_word();
}
return false;
default:
break;
}
Expand Down
1 change: 0 additions & 1 deletion users/muppetjones/muppetjones.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,4 @@ enum userspace_layers {
enum custom_keycodes {
CLMK_DH = SAFE_RANGE,
QWERTY,
CAPSWRD,
};

0 comments on commit f4caf9a

Please sign in to comment.