Home

xmn / bettertrumpet

publicxammen/BetterTrumpet· sync paused
Overview Code History Branches Pull requestsIssuesInsights
master
HomeOverview Code PRsIssues

fix: hotkey recording trapped by focused button and stray state resets

last month

026862f
Authored
xammen8/19/2026, 4:31:48 PM
The log showed shortcuts being registered then silently cleared one
second later. Two causes:

- keyDown on the record buttons had no capture guard, and the button
  keeps focus after recording. Any key pressed afterwards re-recorded
  over the shortcut, and Escape cleared it. Now keyDown ignores keys
  unless that button is actively capturing, and the button blurs
  itself after recording so stray keys cannot touch the shortcut.
- capture state was reset by every bridge 'state' message; states now
  arrive spontaneously (DefaultChanged wiring), which exited an
  in-progress capture mid-keystroke. Capture now ends only on keydown
  or blur.

Also completes the capture UX that failed to apply atomically with the
previous batch: localized 'Press keys · Esc clears' hint and blur
cancels that resume paused global hotkeys (hotkeyCaptureEnded), on
both the global/device list and the preset recorder.

Parent4bc8e46

1 file changed
  • EarTrumpet/SettingsWeb/src/SettingsPages.tsx+11−15