Skip to content

Fix macOS alert sounds from audio shortcuts in the subtitle grid - #762

Merged
arch1t3cht merged 3 commits into
TypesettingTools:masterfrom
suyanhanx:fix-consumed-hotkey-events
Nov 10, 2026
Merged

arch1t3cht merged 3 commits into
TypesettingTools:masterfrom
suyanhanx:fix-consumed-hotkey-events

Conversation

@suyanhanx

@suyanhanx suyanhanx commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #761.

When a key misses the Subtitle Grid context but matches Audio, the first lookup leaves Skip() set. The command runs, but wxWidgets still treats the event as unhandled, causing a system beep on macOS.

Clear the flag when hotkey::check() consumes an event, including the invalid-command error path. No shortcut changes are needed.

Validation: the fix was previously built and manually tested on macOS with default shortcuts, where the playback keys no longer produced the system alert. The existing 376 C++ tests and LuaJIT compatibility check passed during that validation.

@CoffeeFlux

Copy link
Copy Markdown
Member

The fix seems fine, but the weird test scaffolding this adds seems mostly bad and the tests themselves somewhat pointless.

@suyanhanx

Copy link
Copy Markdown
Contributor Author

The fix seems fine, but the weird test scaffolding this adds seems mostly bad and the tests themselves somewhat pointless.

Thank you for the quick reply! I've removed the test part.

@arch1t3cht

Copy link
Copy Markdown
Member

Sorry for the wait.

I think this would be cleaner if there was a single evt.Skip(false) at the top of the hotkey::check() function rather than before the two returns?

(Even then the semantics of how hotkey::check skips events are kind of messy when it's called multiple times, but fixing that would make the caller code more complicated, so that's probably fine for now.)

@suyanhanx

Copy link
Copy Markdown
Contributor Author

Thanks for the suggestion! Moved evt.Skip(false) to the start of hotkey::check() and removed the two branch-local calls in 654d251. The unmatched-key path still calls evt.Skip(), so unhandled keys continue to propagate.

@arch1t3cht

Copy link
Copy Markdown
Member

Thanks!

@arch1t3cht
arch1t3cht merged commit 32ef9fb into TypesettingTools:master Nov 10, 2026
@suyanhanx
suyanhanx deleted the fix-consumed-hotkey-events branch November 10, 2026 12:56
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.

macOS: audio shortcuts beep when the subtitle grid has focus

3 participants