Skip to content

libobs: Prevent loading Mouse1/Mouse2 as hotkeys#13644

Open
krsnaSuraj wants to merge 1 commit into
obsproject:masterfrom
krsnaSuraj:fix/hotkey-mouse1-mouse2-prevent-load
Open

libobs: Prevent loading Mouse1/Mouse2 as hotkeys#13644
krsnaSuraj wants to merge 1 commit into
obsproject:masterfrom
krsnaSuraj:fix/hotkey-mouse1-mouse2-prevent-load

Conversation

@krsnaSuraj

Copy link
Copy Markdown

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

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have read the contributing document.
  • My code has been run through clang-format.
  • My code follows the project's style guidelines
  • My code is not on the master branch.
  • All commit messages are properly formatted and commits squashed where appropriate.

Copilot AI review requested due to automatic review settings July 12, 2026 07:54

This comment was marked as low quality.

@Fenrirthviti

Copy link
Copy Markdown
Member

Please do not request AI reviews in our repository.

@krsnaSuraj

Copy link
Copy Markdown
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.

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.

Prevent loading Mouse1/Mouse2 as hotkeys

3 participants