livesplit-hotkey: Add Hook::new_consuming on macOS #755
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This was also requested in #710 for Windows, so there is some demand for it, though I recognize it diverges from the crate's original use case. If it's not something you want to support I can make a bespoke implementation elsewhere, but this happened to be the cleanest implementation/API I could find of a global shortcut library for macOS.
The API puts the choice of consuming or not on the Hook because it allows us to mark non-consuming hooks listen-only, which removes them as a potential bottleneck from the system input pipeline. I think this is probably desirable for your use case but I'm not certain.
After making this change I verified locally that both
new
andnew_consuming
work as expected, on macOS 13.5.2.