Skip to content

fix(agent): shortcut modifier changes that Heed was refusing itself - #27

Merged
rbstp merged 4 commits into
masterfrom
fix/shortcut-modifier-self-collision
Sep 7, 2026
Merged

rbstp merged 4 commits into
masterfrom
fix/shortcut-modifier-self-collision

Conversation

@rbstp

@rbstp rbstp commented Sep 7, 2026 •

Copy link
Copy Markdown
Owner

Every choice in Shortcut Modifier flashed red and changed nothing. Nothing external held those
combinations — I probed Carbon from a separate process and ⌥⌘ and ⌃⌥ are entirely free. Heed
was refusing them itself, two ways at once.

Two settings pushed onto one combination

The menu rewrote every setting onto the chosen modifier. The toggle is H and focus-left was H
in the README's own example, so both became ⌥⌘H. A combination belongs to one action, so the
second is always refused.

Only the settings already under the modifier being replaced move now. One deliberately given a
different combination — the directional shortcuts carry an extra Option out of the box — keeps it
rather than being flattened onto the same modifier as its neighbours.

Re-asking Carbon for what it already holds

claim registers the new set before releasing the old one, deliberately, so a change can be tried
before working shortcuts are given up. But Carbon refuses a combination this process already
holds, so any setting whose combination was not actually moving got refused by its own live
registration — which is why ⌃⌘ and ⌃⌥⌘ failed on five shortcuts each.

Registrations are kept per setting now, and a setting that is not moving keeps the one it has
instead of asking for it again.

Saying which two settings collided

Two settings on one combination is found before anything is registered, so the log can name both
sides instead of reporting whichever one Carbon happened to turn down as "already taken by another
app". The later claim is dropped and the rest still register, so a configuration written that way
starts with every other shortcut working; the menu still applies all or nothing.

The README was the trap

The directional example used HJKL, and the toggle is H. The two differ by modifier and both
register happily, but Shortcut Modifier can then never put them under one modifier. The example is
WASD now, with a note saying why.


Checked against real settings, where all four presets used to fail:

preset before after (HJKL) after (WASD)
⌃⌘ (current) clash + 4 re-asked no change, reports success ✅
⌥⌘ clash applies ✅
⌃⌥ clash applies ✅
⌃⌥⌘ clash + 4 re-asked refused, and says why ✅

With HJKL the last one is genuinely impossible rather than a bug — the toggle would land on
⌃⌥⌘H, which focus-left has — and it now says so instead of "not free". With the WASD example all
four apply. Confirmed by hand in the menu: three saved before the README change, all four after.

265 tests pass, 11 of them new. Also verified live that a deliberately conflicting configuration
(focusNextHotkey set to the toggle's own combination) logs
hotkey ⌃⌘H already toggles Heed, so nothing moves focus to the next window and registers
everything else.

Every choice in Shortcut Modifier flashed red. Nothing external held the combinations:
Heed was refusing them itself, two ways at once.

- The menu rewrote every setting onto the chosen modifier, so the toggle and focus left,
  which are both H by default, landed on the same combination. A combination belongs to
  one action, so that pair can never both be registered. Only the settings already under
  the modifier being replaced move now; one deliberately given a different combination,
  as the directional shortcuts are, keeps it.
- `claim` registers the new set before releasing the old, so a change can be tried before
  working shortcuts are given up -- but Carbon refuses a combination this process already
  holds, so any setting whose combination was not moving was refused by its own live
  registration. Registrations are kept per setting now, and one that is not moving keeps
  what it has instead of asking again.

Two settings on one combination is found before anything is registered, so the log names
both sides rather than reporting whichever one Carbon happened to turn down. The later
claim is dropped and the rest still register, so a configuration written that way starts
with every other shortcut working; the menu still applies all or nothing.
The toggle is H, so the HJKL example put two shortcuts on that key. They differ by
modifier and both register, but Shortcut Modifier can then never put them under one
modifier, and it refuses the whole change rather than half applying it.
…fier change makes

Three ways the first pass got the reporting or the verdict wrong, found reviewing it.

A clash between two settings the change never touches used to refuse the change. Two
directional settings written onto one combination would refuse every preset for good,
blaming the preset, which is the symptom this was meant to end. `claim` reports both
sides of every clash now, and the menu only gives up when one of them is a setting it
was actually moving.

The registrations are deliberately not released before the new set is claimed, so a
combination another setting is still holding came back from Carbon as another app having
it -- the wrong words again, on the path the README sends people down. Asked of the
standing registrations first, it names the setting that has it.

`firstClash` returns the combination as well as the two names: the caller reconstructed
it from the first claim, which for the numbered shortcut is the first of nine and not
necessarily the one contested.

The tick in the menu came from the claimed specs while `changeModifiers` read the raw
settings, so a toggle whose text parses but whose registration was refused could put the
tick on one modifier and replace another, and report success for a change it never made.
Both read the settings now.
@rbstp
rbstp merged commit b76d4b5 into master Sep 7, 2026
1 check passed
@rbstp
rbstp deleted the fix/shortcut-modifier-self-collision branch September 7, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant