mirror of
https://github.com/qmk/qmk_firmware.git
synced 2024-11-22 19:39:27 +00:00
95c43a2759
* 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> |
||
---|---|---|
.. | ||
audio | ||
backlight | ||
bootmagic | ||
debounce | ||
encoder/tests | ||
keymap_extras | ||
led_matrix | ||
logging | ||
painter | ||
pointing_device | ||
process_keycode | ||
rgb_matrix | ||
rgblight | ||
send_string | ||
sequencer | ||
split_common | ||
wear_leveling | ||
action_code.h | ||
action_layer.c | ||
action_layer.h | ||
action_tapping.c | ||
action_tapping.h | ||
action_util.c | ||
action_util.h | ||
action.c | ||
action.h | ||
bitwise.c | ||
bitwise.h | ||
caps_word.c | ||
caps_word.h | ||
color.c | ||
color.h | ||
command.c | ||
command.h | ||
config_common.h | ||
crc.c | ||
crc.h | ||
debounce.h | ||
deferred_exec.c | ||
deferred_exec.h | ||
digitizer.c | ||
digitizer.h | ||
dip_switch.c | ||
dip_switch.h | ||
dynamic_keymap.c | ||
dynamic_keymap.h | ||
dynamic_macro.h | ||
eeconfig.c | ||
eeconfig.h | ||
encoder.c | ||
encoder.h | ||
haptic.c | ||
haptic.h | ||
joystick.c | ||
joystick.h | ||
keyboard.c | ||
keyboard.h | ||
keycode_config.c | ||
keycode_config.h | ||
keycode_legacy.h | ||
keycode.h | ||
keymap_common.c | ||
keymap_introspection.c | ||
keymap_introspection.h | ||
keymap.h | ||
led_tables.c | ||
led_tables.h | ||
led.c | ||
led.h | ||
main.c | ||
matrix_common.c | ||
matrix.c | ||
matrix.h | ||
mousekey.c | ||
mousekey.h | ||
programmable_button.c | ||
programmable_button.h | ||
quantum_keycodes_legacy.h | ||
quantum_keycodes.h | ||
quantum.c | ||
quantum.h | ||
raw_hid.h | ||
ring_buffer.h | ||
secure.c | ||
secure.h | ||
sync_timer.c | ||
sync_timer.h | ||
utf8.c | ||
utf8.h | ||
util.h | ||
variable_trace.c | ||
variable_trace.h | ||
velocikey.c | ||
velocikey.h | ||
via_ensure_keycode.h | ||
via.c | ||
via.h | ||
virtser.h | ||
wpm.c | ||
wpm.h |