Original QMK firmware repository https://qmk.fm
Find a file
Pascal Getreuer 73e2ef486a
[Bug][Core] Fix for Flow Tap: fix handling of distinct taps and timer updates. (#25175)
* Flow Tap bug fix.

As reported by @amarz45 and @mwpardue, there is a bug where if two
tap-hold keys are pressed in distinct taps back to back, then Flow Tap
is not applied on the second tap-hold key, but it should be.

In a related bug reported by @NikGovorov, if a tap-hold key is held
followed by a tap of a tap-hold key, then Flow Tap updates its timer on
the release of the held tap-hold key, but it should be ignored.

The problem common to both these bugs is that I incorrectly assumed
`tapping_key` is cleared to noevent once it is released, when actually
`tapping_key` is still maintained for `TAPPING_TERM` ms after release
(for Quick Tap). This commit fixes that. Thanks to @amarz45, @mwpardue,
and @NikGovorov for reporting!

Details:

* Logic for converting the current tap-hold event to a tap is extracted
  to `flow_tap_key_if_within_term()`, which is now invoked also in the
  post-release "interfered with other tap key" case. This fixes the
  distinct taps bug.

* The Flow Tap timer is now updated at the beginning of each call to
  `process_record()`, provided that there is no unsettled tap-hold key
  at that time and that the record is not for a mod or layer switch key.
  By moving this update logic to `process_record()`, it is conceptually
  simpler and more robust.

* Unit tests extended to cover the reported scenarios.

* Fix formatting.

* Revision to fix @NikGovorov's scenario.

The issue is that when another key is pressed while a layer-tap hasn't
been settled yet, the `prev_keycode` remembers the keycode from before
the layer switched. This can then enable Flow Tap for the following key
when it shouldn't, or vice versa.

Thanks to @NikGovorov for reporting!

This commit revises Flow Tap in the following ways:

* The previous key and timer are both updated from `process_record()`.
  This is slightly later in the sequence of processing than before, and
  by this point, a just-settled layer-tap should have taken effect so
  that the keycode from the correct layer is remembered.

* The Flow Tap previous key and timer are updated now also on key
  release events, except for releases of modifiers and held layer
  switches.

* The Flow Tap previous key and timer are now updated together, for
  simplicity. This makes the logic easier to think about.

* A few additional unit tests, including @NikGovorov's scenario as
  "layer_tap_ignored_with_disabled_key_complex."
2025-04-22 09:59:49 +02:00
.github Merge remote-tracking branch 'origin/master' into develop 2025-03-26 19:24:00 +00:00
.vscode Far better VSCode intellisense support using clangd. (#20382) 2023-05-14 15:32:34 +10:00
builddefs Implement connection keycode logic (#25176) 2025-04-21 22:27:56 +01:00
data Allow for disabling EEPROM subsystem entirely. (#25173) 2025-04-19 20:20:00 +01:00
docs Merge remote-tracking branch 'origin/master' into develop 2025-04-20 09:42:05 +00:00
drivers Implement connection keycode logic (#25176) 2025-04-21 22:27:56 +01:00
keyboards Merge remote-tracking branch 'origin/master' into develop 2025-04-22 04:15:10 +00:00
layouts Merge remote-tracking branch 'origin/master' into develop 2025-03-20 21:55:29 +00:00
lib Add lint warning for empty url (#25182) 2025-04-21 20:07:05 +01:00
modules/qmk Add "license" field to Community Module JSON schema. (#25085) 2025-04-01 16:06:42 +11:00
platforms Cater for use of __errno_r() in ChibiOS syscalls.c with newer picolibc revisions (#25121) 2025-04-10 01:43:25 +01:00
quantum [Bug][Core] Fix for Flow Tap: fix handling of distinct taps and timer updates. (#25175) 2025-04-22 09:59:49 +02:00
tests [Bug][Core] Fix for Flow Tap: fix handling of distinct taps and timer updates. (#25175) 2025-04-22 09:59:49 +02:00
tmk_core Align ChibiOS USB_WAIT_FOR_ENUMERATION implementation (#25184) 2025-04-22 14:31:42 +10:00
users Add EOL to non-keyboard files (#24990) 2025-03-06 23:17:51 +00:00
util [Core] use keycode_string in unit tests (#25042) 2025-03-21 08:47:22 +01:00
.clang-format Clang-format tweaks (#15906) 2022-02-11 20:00:34 -08:00
.clangd Fix for .clangd. (#25180) 2025-04-22 00:02:47 +10:00
.editorconfig .editorconfig: fix inline comment, tidy name section for yaml (#24416) 2024-09-21 19:48:31 +01:00
.gitattributes eol=lf, where appropriate (#15752) 2022-01-05 21:56:31 +00:00
.gitignore Add via keymaps to gitignore (#24329) 2024-08-26 04:33:40 +01:00
.gitmodules [Core] Quantum Painter - LVGL Integration (#18499) 2022-12-13 07:51:14 +11:00
Doxyfile Remove arm_atsam platform (#24337) 2024-09-02 03:48:17 +01: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 Resolve keyboard_aliases when processing keyboard make targets (#24834) 2025-01-30 06:22:05 +11:00
nose2.cfg Setup a python test framework 2019-09-07 07:58:41 -07:00
paths.mk Remove quantum/audio from global VPATH (#18753) 2022-10-20 14:41:45 +01:00
readme.md Branch point for 2025q2 breaking change. 2025-02-28 09:26:13 +11:00
requirements-dev.txt Macros in JSON keymaps (#14374) 2021-11-22 11:11:35 -08:00
requirements.txt Align to latest CLI dependencies (#24553) 2025-03-20 14:04:10 +11:00
setup.cfg Quantum Painter (#10174) 2022-04-13 18:00:18 +10:00
shell.nix Nix shell updates (Nixpkgs 2024-02-23, QMK CLI 1.1.5) (#23143) 2024-02-26 13:04:27 +11:00

THIS IS THE DEVELOP BRANCH

Warning- This is the develop branch of QMK Firmware. You may encounter broken code here. Please see Breaking Changes 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 VitePress. 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.

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.