Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Achordion: unregister eager mods in settle_as_hold
Fixes #17 Currently, mods can get stuck if the mod is both eager and using the one-shot mod-tap trick described here: https://getreuer.info/posts/keyboards/achordion/index.html#one-shot-mod-tap-key This commit fixes that. Outline of how the stuck mod happened: 1. On press, the eager mod is registered. 2. Suppose the key continues to be held without other keys pressed. On timeout, `settle_as_hold()` is called to settle the key as held. 3. The default effect of holding a mod-tap key is (of course) to apply the mod. For this reason when the mod is eager, the current mod simply leaves the mod in effect, but sets `eager_mods = 0`. 4. In `process_record_user()`, the one-shot mod-tap handling code intercepts the hold press event, applying the one-shot behavior. 5. When the key is released, Achordion does *not* unregister the eager mod, since the key was settled. 6. In `process_record_user()`, the one-shot mod-tap handling code does nothing on release. The one-shot mod is released, as it should, but the regular mod is still stuck, since the eager mod was never cleared. The fix is to unregister the mod in step 3. Thanks to @jasonkena for reporting this.
- Loading branch information