Commit Graph

55 Commits

Author SHA1 Message Date
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
Pascal Getreuer
8d8dcb089e
[Core] Flow Tap tap-hold option to disable HRMs during fast typing (#25125)
aka Global Quick Tap, Require Prior Idle
2025-04-14 09:46:24 -07:00
John
b69bf4b885
Retro Tapping Re-Write; Key Roll Fix (#23641) 2025-02-16 20:50:42 +11:00
DavidSannier
3ab2b3b6e2
Chaining OSL and MO (#23065) 2025-02-16 20:48:40 +11:00
Ryan
f8596b40a4
Normalise mouse keycodes (#23975) 2024-07-03 18:35:54 +10:00
DavidSannier
c92277a8ae
Remove unuseful layer_on() call (#23055) 2024-03-13 00:19:23 -07:00
Skyler Hawthorne
13434fc066
Insert delay between shifted chars in send_string_with_delay (#19280) 2024-02-17 01:01:01 +11:00
Ryan
0c160e1fba
Separate 6KRO and NKRO report structs (#22267) 2023-10-23 15:43:46 +11:00
NapOli1084
e0eb90aba1
Fix OSM on a OSL activated layer (#20410) 2023-09-25 12:53:12 +10:00
Isaac Elenbaas
dd94877ec6
Improve test invocation, fix Retro Shift bugs, and add Auto+Retro Shift test cases (#15889) 2023-09-25 12:45:49 +10:00
precondition
1abf8f3e8b
[Feature] Send a dummy keycode to neutralize flashing modifiers in retro tap and key overrides (#20992) 2023-07-08 00:18:02 +10:00
Ryan
7ff80a57cb
Get rid of USB_LED_SCROLL_LOCK (#21405) 2023-07-02 19:24:22 +01:00
Pascal Getreuer
3993b15f05
[Core] Add Repeat Key ("repeat last key") as a core feature. (#19700)
Co-authored-by: casuanoob <96005765+casuanoob@users.noreply.github.com>
Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
2023-05-20 22:35:06 +10:00
Albert Y
128f808496
Add a user callback for pre process record (#20584) 2023-05-13 08:42:06 +01:00
Drashna Jaelre
aec882528a
[Bug] Fix compilation error introduced by #20669 (#20849) 2023-05-11 00:06:12 +01:00
Pete Sevander
8a332e6f01
Fix Mod-Tap combo regression (#20669)
* Add keyevent for combo keyrecord

* Fix formatting

* Update quantum/process_keycode/process_combo.c

Co-authored-by: Sergey Vlasov <sigprof@gmail.com>

* Add combo unit-tests and hot-fix process_record_tap_hint

...as this function tries to lookup the combo keys passed in. This will
be refactored in a later pr.

---------

Co-authored-by: Sergey Vlasov <sigprof@gmail.com>
Co-authored-by: Stefan Kerkmann <karlk90@pm.me>
2023-05-10 17:59:52 +02:00
Albert Y
f5b7491883
Add swap hands toggle functions (#20381) 2023-04-09 09:37:31 -07:00
Drashna Jaelre
7115927559
[Bug] Fix compilation issue with Swap Hands and Encoder Map (#20348) 2023-04-05 23:36:08 +01:00
Kasimir Pihlasviita
46844347c4
Fix OSMs getting stuck (#20034) 2023-04-03 15:38:44 +10:00
precondition
1899793f27
Make IGNORE_MOD_TAP_INTERRUPT the default behaviour for mod-taps (#20211) 2023-04-03 15:32:47 +10:00
Joel Challis
c485d1cf26
Remove use of keymap.h (#20004) 2023-03-27 20:08:17 +01:00
Drashna Jaelre
48a79b08cc
Fix functions when NO_ACTION_TAPPING is defined (#11528) 2023-02-19 12:08:03 +11:00
Albert Y
9908ed7ecd
Add swap hands status function (#19831)
Co-authored-by: Drashna Jaelre <drashna@live.com>
2023-02-14 12:44:18 -08:00
Nick Brassel
b8ac4dddb6
Fixup develop compiles. (#19828) 2023-02-13 08:57:23 +11:00
Joel Challis
6ceff1367d
Tidy up use of keycode range helpers (#19813) 2023-02-12 17:09:34 +00:00
Joel Challis
1d0b4c8d38
Tidy up use of keycode range helpers (#19756) 2023-02-10 21:10:14 +00:00
Ryan
cf935d97ae
Fix functions with empty params (#19647)
* Fix functions with empty params

* Found a bunch more
2023-01-20 16:21:17 +00:00
David Kosorin
0f5500182c
Allow mod-tap hold action on one shot layer (#19214) 2023-01-02 11:16:24 +01:00
Stefan Kerkmann
85984902cf
Introduce IS_EVENT instead of !IS_NOEVENT (#19366) 2022-12-17 14:06:27 +00:00
Stefan Kerkmann
dedc54a328
[Core] guard action related debug messages (#19348) 2022-12-15 23:38:25 +01:00
precondition
515dd18c28
Remove IGNORE_MOD_TAP_INTERRUPT_PER_KEY in favour of HOLD_ON_OTHER_KEY_PRESS_PER_KEY (#15741) 2022-12-13 22:20:07 +11:00
Ryan
f0b2bfd5ca
Programmable Button API refactor and improve docs (#18641) 2022-10-15 14:33:24 +11:00
Ryan
2c96c75263
Small un/register_code() cleanups (#18544) 2022-09-30 16:29:24 -04:00
Drashna Jaelre
dbe214c326
Handle mouse keys more consistently (#18513) 2022-09-29 10:50:47 -07:00
Drashna Jaelre
fb400f2ac2
Enabling Pointing Device support in register code functions (#18363) 2022-09-26 20:49:32 -07:00
Drashna Jaelre
d909038b28
Move Oneshot mod callbacks to after mods are set (#18101) 2022-09-26 20:49:15 -07:00
Stefan Kerkmann
8ce946b5c8
[Bug] Add key event check to is_tap_record and remove is_tap_key (#18063) 2022-08-15 16:40:51 +02:00
precondition
d44a950c10
Use TAP_HOLD_CAPS_DELAY for KC_LOCKING_CAPS_LOCK (#17099) 2022-05-30 22:55:33 -07:00
Denis Savran
b1ceb4bb6a
Fix one-shot locked modifiers (#16114)
* Fix state updates of one-shot locked modifiers

Activating additional one-shot locked modifiers removed previously enabled locked modifiers from the state.
`get_oneshot_locked_mods` returned zero when two or more one-shot locked modifiers were enabled and then one was disabled.

* Do not delete one-shot locked modifiers on a one-shot layer toggle

Non-locked one-shot modifiers are not removed so this behavior adds inconsistency.
Also the one-shot locked modifiers state was reset without unregistering any modifiers.
2022-04-18 02:12:25 -07:00
Drashna Jaelre
b8574efcd6
Fix oneshot toggle logic (#16630)
* Fix oneshot toggle logic

* Enable oneshots by default

* Decrement eeconfig magic number due to eeconfig changes
2022-03-14 01:11:42 +00:00
Nick Brassel
77180a6649
Fixup builds. (#16596) 2022-03-09 17:09:38 +00:00
Nick Brassel
8d5eacb7dd
Add support for encoder mapping. (#13286) 2022-03-09 19:29:00 +11:00
QMK Bot
25ba9b41c1
Format code according to conventions (#16421) 2022-02-21 08:29:54 -08:00
QMK Bot
63646e8906
Format code according to conventions (#16322) 2022-02-12 18:29:31 +00:00
Ryan
1d11ae3087
Rip out old macro and action_function system (#16025)
* Rip out old macro and action_function system

* Update quantum/action_util.c

Co-authored-by: Joel Challis <git@zvecr.com>
2022-01-24 21:22:20 +00:00
Drashna Jaelre
672c6b4721
Make (un)register code functions weak (#15285) 2021-12-27 12:15:56 +11:00
Isaac Elenbaas
d9393b8684
Add Retro Shift (Auto Shift for Tap Hold via Retro Tapping) and Custom Auto Shifts (#11059)
* Add Retro Shift and Custom Auto Shifts

* Fix compilation errors with no RETRO_SHIFT value
2021-11-25 23:12:14 +11:00
Ryan
f529580860
Basic keycode overhaul (#14726) 2021-11-03 22:22:17 -07:00
Joel Challis
92385e30cd
Manually format develop (#15003) 2021-11-01 19:18:33 +00:00
Drashna Jaelre
2980c63d3d
Fix issues with Oneshot disabling (#14934) 2021-11-01 09:41:24 -07:00