Repository navigation
fix(macro): never lose the release of what a macro pressed - #1247
colonelpanic8 wants to merge 2 commits into
Conversation
The ops after `pause_for_release` are queued when the macro key comes up. If four macros had filled the queue by then, that release half was dropped, so a macro like `down LCtrl, pause, up LCtrl` left Ctrl held. A press that stops at a pause now keeps a place in the queue for its release half, and a trigger that would take that place is the one dropped. A release half runs only for a press that kept a place. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Vial reset or buffer write, or a Rynk macro write, ends the macros playing by emptying the queue. A macro stopped between `down LCtrl` and its `up LCtrl` lost the release with the rest of its ops, and Ctrl stayed down. The macros now remember what their `down` ops pressed and their `up` ops have not released. A change that stops them releases those first, as the next macro steps, through the same release path as a macro's own `up`, so a key the user holds physically stays down. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
|
Two ways a macro introduced in #1168 could leave Ctrl held:
down LCtrl, pause_for_release, up LCtrldropped its release half when four macros had filled the queue by the time the key came up, and a Vial reset or buffer write, or a RynkSetMacro, duringdown LCtrl, delay, up LCtrldropped theupwith the rest of the macro. A press stopped at a pause now keeps a queue place for its release half, and a change that stops the macros releases what theirdownops still hold, through the macro's own release path, so a key the user is physically holding stays down.The releases after a stop play at the stopped macro's next step (the end of its current delay, or the next key event), since host writes don't wake the keyboard task.
Tests:
macros::macro_release_half_is_never_dropped,vial::macro_reset_releases_what_the_macro_holds, andrynk_macro::macro_write_releases_what_the_macro_holds, each failing before its fix.🤖 Generated with Claude Code