libobs: Prevent loading Mouse1/Mouse2 as hotkeys#13644
Open
krsnaSuraj wants to merge 1 commit into
Open
Conversation
Member
|
Please do not request AI reviews in our repository. |
Author
|
@Fenrirthviti My apologies - the Copilot auto-review was enabled by default on my account and I didn't realize it was automatically requesting reviews. I've disabled the setting now. Thanks for letting me know. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Prevents Mouse1 and Mouse2 from being loaded as hotkey bindings. The UI already blocks these from being set, but if someone manually edits their scene collection JSON to add these as hotkeys, OBS would previously still load them and cause unexpected behavior.
The fix adds a validation guard in create_binding() - the single choke point through which ALL hotkey bindings are created. This covers both JSON loading (load_binding ? create_binding) and programmatic binding (obs_hotkey_load_bindings ? create_binding) paths.
Motivation and Context
Fixes #13403
How Has This Been Tested?
Code review and verification of the guard logic. The change is small and targeted - any attempt to bind Mouse1 or Mouse2 is now rejected with a LOG_WARNING diagnostic message.
Types of changes
Checklist: