No description
Find a file
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>
2022-08-14 20:25:32 +01:00
.github Merge remote-tracking branch 'origin/master' into develop 2022-08-08 18:06:29 +00:00
.vscode
builddefs Fix Emulated EEPROM issue with F466 (#18039) 2022-08-14 17:18:59 +01:00
data [Controller] Added board config for custom controller STeMCell (#16287) 2022-08-14 21:27:26 +10:00
docs Added emacs as an "operating system" for input mode. (#16949) 2022-08-14 20:24:52 +01:00
drivers Add led matrix support for CKLED2001 (#17643) 2022-08-13 14:39:06 +01:00
keyboards [Keyboard] Fix compilation issues for Boardsource Microdox (#18037) 2022-08-14 17:03:40 +01:00
layouts
lib Improve importer workflow (#17707) 2022-08-13 14:39:56 +01:00
platforms [Controller] Added board config for custom controller STeMCell (#16287) 2022-08-14 21:27:26 +10:00
quantum Fix Caps Word to treat mod-taps more consistently. (#17463) 2022-08-14 20:25:32 +01:00
tests Fix Caps Word to treat mod-taps more consistently. (#17463) 2022-08-14 20:25:32 +01:00
tmk_core Remove tmk_core 'serial' code (#17866) 2022-08-08 03:13:16 +01:00
users Merge remote-tracking branch 'origin/master' into develop 2022-08-13 16:24:37 +00:00
util Merge remote-tracking branch 'origin/master' into develop 2022-08-13 13:24:07 +00:00
.clang-format
.editorconfig
.gitattributes
.gitignore
.gitmodules
Dockerfile
Doxyfile
doxygen-todo
LICENSE
license_GPLv2.md
license_GPLv3.md
license_Modified_BSD.md
Makefile Merge remote-tracking branch 'origin/master' into develop 2022-08-13 13:24:07 +00:00
nose2.cfg
paths.mk
readme.md
requirements-dev.txt
requirements.txt
setup.cfg
shell.nix
Vagrantfile

This is the develop branch!

See the Breaking Changes document for more information.

Quantum Mechanical Keyboard Firmware

Current Version Discord Docs Status GitHub contributors GitHub forks

This is a keyboard firmware based on the tmk_keyboard firmware with some useful features for Atmel AVR and ARM controllers, and more specifically, the OLKB product line, the ErgoDox EZ keyboard, and the Clueboard product line.

Documentation

The docs are powered by Docsify and hosted on GitHub. They are also viewable offline; see Previewing the Documentation for more details.

You can request changes by making a fork and opening a pull request, or by clicking the "Edit this page" link at the bottom of any page.

Supported Keyboards

The project also includes community support for lots of other keyboards.

Maintainers

QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, Hasu. The OLKB product firmwares are maintained by Jack Humbert, the Ergodox EZ by ZSA Technology Labs, the Clueboard by Zach White, and the Atreus by Phil Hagelberg.

Official Website

qmk.fm is the official website of QMK, where you can find links to this page, the documentation, and the keyboards supported by QMK.