1
0
Fork 0
forked from forks/qmk_firmware
Open-source keyboard firmware for Atmel AVR and Arm USB families
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 remove Bracket Pair Colorizer recommendation (#14816) 2021-10-15 11:54:19 +11:00
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 Update ginkgo65hot to allow use of community layouts (#17911) 2022-08-06 13:29:06 -07:00
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 Clang-format tweaks (#15906) 2022-02-11 20:00:34 -08:00
.editorconfig QMK CLI and JSON keymap support (#6176) 2019-07-15 12:14:27 -07:00
.gitattributes eol=lf, where appropriate (#15752) 2022-01-05 21:56:31 +00:00
.gitignore Add .orig to .gitignore (#17626) 2022-07-17 04:38:56 +10:00
.gitmodules [Core] Add Raspberry Pi RP2040 support (#14877) 2022-06-30 13:19:27 +02:00
Dockerfile move everything from qmkfm/base_container to qmkfm/qmk_cli (#14230) 2021-08-29 16:41:56 -07:00
Doxyfile Internal docs generation updates (#16411) 2022-02-21 15:47:44 +00:00
doxygen-todo Remove SERIAL_LINK feature (#14727) 2021-10-07 12:32:05 +11:00
LICENSE add an explicit lisence file for github to pickup 2017-11-13 20:50:54 -05:00
license_GPLv2.md Clarify the quantum license (#1042) 2017-03-28 15:20:36 -07:00
license_GPLv3.md Clarify the quantum license (#1042) 2017-03-28 15:20:36 -07:00
license_Modified_BSD.md Clarify the quantum license (#1042) 2017-03-28 15:20:36 -07:00
Makefile Merge remote-tracking branch 'origin/master' into develop 2022-08-13 13:24:07 +00:00
nose2.cfg Setup a python test framework 2019-09-07 07:58:41 -07:00
paths.mk Migrate more makefile utilities to builddefs sub-directory (#16002) 2022-02-10 09:45:51 -08:00
readme.md Branch point after 2022-05-28 Breaking Change. 2022-05-29 08:16:00 +10:00
requirements-dev.txt Macros in JSON keymaps (#14374) 2021-11-22 11:11:35 -08:00
requirements.txt Quantum Painter (#10174) 2022-04-13 18:00:18 +10:00
setup.cfg Quantum Painter (#10174) 2022-04-13 18:00:18 +10:00
shell.nix Remove Nixpkgs-provided poetry from the environment (#17673) 2022-07-18 22:52:55 +03:00
Vagrantfile move everything from qmkfm/base_container to qmkfm/qmk_cli (#14230) 2021-08-29 16:41:56 -07:00

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.