You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Pascal Getreuer 95c43a2759
Fix Caps Word to treat mod-taps more consistently. (#17463)
* Fix Caps Word to treat mod-taps more consistently.

Previously, holding any mod-tap key while Caps Word is active stops Caps
Word, and this happens regardless of `caps_word_press_user()`. Yet for
regular mod keys, AltGr (KC_RALT) is ignored, Shift keys are passed to
`caps_word_press_user()` to determine whether to continue, and
similarly, a key `RSFT(KC_RALT)` representing Right Shift + Alt is
passed to `caps_word_press_user()` to determine whether to continue.

This commit makes held mod-tap keys consistent with regular mod keys:

* Holding a `RALT_T` mod-tap is ignored.
* When holding a shift mod-tap key, `KC_LSFT` or `KC_RSFT` is passed to
  `caps_word_press_user()` to determine whether to continue.
* When holding a Right Shift + Alt (`RSA_T`) mod-tap, `RSFT(KC_RALT)` is
  passed to `caps_word_press_user()`.

Particularly, with this fix a user may choose to continue Caps Word when
a shift mod-tap key is held by adding `KC_LSFT` and `KC_RSFT` cases in
`caps_word_press_user()`. For instance as

```
bool caps_word_press_user(uint16_t keycode) {
  switch (keycode) {
    // Keycodes that continue Caps Word, with shift applied.
    case KC_A ... KC_Z:
    case KC_MINS:
      add_weak_mods(MOD_BIT(KC_LSFT));  // Apply shift to the 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_LSFT:  // <<< Added here.
    case KC_RSFT:
      return true;

    default:
      return false;  // Deactivate Caps Word.
  }
}
```

* Fix Caps Word to treat mod-taps more consistently.

Previously, holding any mod-tap key while Caps Word is active stops Caps
Word, and this happens regardless of `caps_word_press_user()`. Yet for
regular mod keys, AltGr (KC_RALT) is ignored, Shift keys are passed to
`caps_word_press_user()` to determine whether to continue, and
similarly, a key `RSFT(KC_RALT)` representing Right Shift + Alt is
passed to `caps_word_press_user()` to determine whether to continue.

This commit makes held mod-tap keys consistent with regular mod keys:

* Holding a `RALT_T` mod-tap is ignored.
* When holding a shift mod-tap key, `KC_LSFT` or `KC_RSFT` is passed to
  `caps_word_press_user()` to determine whether to continue.
* When holding a Right Shift + Alt (`RSA_T`) mod-tap, `RSFT(KC_RALT)` is
  passed to `caps_word_press_user()`.

Particularly, with this fix a user may choose to continue Caps Word when
a shift mod-tap key is held by adding `KC_LSFT` and `KC_RSFT` cases in
`caps_word_press_user()`. For instance as

```
bool caps_word_press_user(uint16_t keycode) {
  switch (keycode) {
    // Keycodes that continue Caps Word, with shift applied.
    case KC_A ... KC_Z:
    case KC_MINS:
      add_weak_mods(MOD_BIT(KC_LSFT));  // Apply shift to the 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_LSFT:  // <<< Added here.
    case KC_RSFT:
      return true;

    default:
      return false;  // Deactivate Caps Word.
  }
}
```

* Update quantum/process_keycode/process_caps_word.c

Co-authored-by: Joel Challis <git@zvecr.com>
3 years ago
..
audio In honor of king terry (#17387) 4 years ago
backlight Fix AVR backlight breathing: low brightness limit & exceeding breathing table max index (#16770) 4 years ago
bootmagic
debounce Make debounce() signal changes in the cooked matrix as return value (#17554) 3 years ago
encoder/tests
keymap_extras Replace ; by : in the shifted symbols ASCII art of keymap_norman (#18029) 3 years ago
led_matrix Add led matrix support for CKLED2001 (#17643) 3 years ago
logging [Fix] Patches after printf library update (#17584) 3 years ago
painter Add ST7735 driver to Quantum Painter (#17848) 3 years ago
pointing_device Always run pointing device init (#17936) 3 years ago
process_keycode Fix Caps Word to treat mod-taps more consistently. (#17463) 3 years ago
rgb_matrix Refactor Pixel Fractal effect (#17602) 3 years ago
rgblight Remove ARM pgm_read_word workaround in rgblight (#16961) 4 years ago
send_string Feature-ify Send String (#17275) 3 years ago
sequencer
split_common [Core] guard RPC invocation by checking RPC info against crc checksum (#17840) 3 years ago
wear_leveling RP2040 emulated EEPROM. (#17519) 3 years ago
action.c Use TAP_HOLD_CAPS_DELAY for KC_LOCKING_CAPS_LOCK (#17099) 4 years ago
action.h
action_code.h Align TO() max layers with other keycodes (#17989) 3 years ago
action_layer.c
action_layer.h Make default layer size 16-bit (#15286) 4 years ago
action_tapping.c Do not enable PERMISSIVE_HOLD when TAPPING_TERM exceeds 500ms (#15674) 4 years ago
action_tapping.h Add GET_TAPPING_TERM macro to reduce duplicate code (#16681) 4 years ago
action_util.c Fix oneshot toggle logic (#16630) 4 years ago
action_util.h
bitwise.c
bitwise.h
caps_word.c [Core] Add Caps Word feature to core (#16588) 4 years ago
caps_word.h [Core] Add Caps Word feature to core (#16588) 4 years ago
color.c
color.h
command.c [Fix] Patches after printf library update (#17584) 3 years ago
command.h Remove legacy keycode use from command (#18002) 3 years ago
config_common.h
crc.c
crc.h
debounce.h Make debounce() signal changes in the cooked matrix as return value (#17554) 3 years ago
deferred_exec.c
deferred_exec.h
digitizer.c
digitizer.h
dip_switch.c
dip_switch.h
dynamic_keymap.c Avoid OOB in dynamic_keymap_reset (#17695) 3 years ago
dynamic_keymap.h
dynamic_macro.h
eeconfig.c Fix oneshot toggle logic (#16630) 4 years ago
eeconfig.h Fix oneshot toggle logic (#16630) 4 years ago
encoder.c Improve ENCODER_DEFAULT_POS to recognize lost ticks (#16932) 3 years ago
encoder.h
haptic.c [Feature] Add support for multiple switchs/solenoids to Haptic Feedback engine (#15657) 4 years ago
haptic.h
joystick.c Joystick feature updates (#16732) 4 years ago
joystick.h Joystick: Simplify report descriptor and clean up error messages (#16926) 4 years ago
keyboard.c [Core] Process all changed keys in one scan loop, deprecate `QMK_KEYS_PER_SCAN` (#15292) 3 years ago
keyboard.h [Core] Process all changed keys in one scan loop, deprecate `QMK_KEYS_PER_SCAN` (#15292) 3 years ago
keycode.h
keycode_config.c PoC: Swap Escape and Caps (#16336) 3 years ago
keycode_config.h PoC: Swap Escape and Caps (#16336) 3 years ago
keycode_legacy.h
keymap.h [Core] Add Raspberry Pi RP2040 support (#14877) 3 years ago
keymap_common.c Align TO() max layers with other keycodes (#17989) 3 years ago
keymap_introspection.c Allow for `keymaps` array to be implemented in a file other than `$(KEYMAP_C)` (#17559) 3 years ago
keymap_introspection.h Add keymap wrappers for introspection into the keymap. (#17229) 4 years ago
led.c Expose the time of the last change to the LED state (#17222) 3 years ago
led.h Expose the time of the last change to the LED state (#17222) 3 years ago
led_tables.c
led_tables.h
main.c Quantum Painter (#10174) 4 years ago
matrix.c Make debounce() signal changes in the cooked matrix as return value (#17554) 3 years ago
matrix.h
matrix_common.c Merge remote-tracking branch 'origin/master' into develop 3 years ago
mousekey.c Merge remote-tracking branch 'origin/master' into develop 3 years ago
mousekey.h Merge remote-tracking branch 'origin/master' into develop 3 years ago
programmable_button.c
programmable_button.h
quantum.c Fix QK_MAKE's reboot check (#17795) 3 years ago
quantum.h implement `tap_code16_delay` (#17748) 3 years ago
quantum_keycodes.h Added emacs as an "operating system" for input mode. (#16949) 3 years ago
quantum_keycodes_legacy.h Removes terminal from QMK. (#17258) 4 years ago
raw_hid.h
ring_buffer.h
secure.c Enhancement and fixes of "Secure" feature (#16958) 4 years ago
secure.h Enhancement and fixes of "Secure" feature (#16958) 4 years ago
sync_timer.c
sync_timer.h
utf8.c Quantum Painter (#10174) 4 years ago
utf8.h Quantum Painter (#10174) 4 years ago
util.h
variable_trace.c
variable_trace.h
velocikey.c
velocikey.h
via.c VIA Encoder Map Support (#17734) 3 years ago
via.h VIA Encoder Map Support (#17734) 3 years ago
via_ensure_keycode.h
virtser.h
wpm.c
wpm.h