libobs: Reject hotkey bindings on Mouse1/Mouse2#13404
Open
mbokinala wants to merge 1 commit intoobsproject:masterfrom
Open
libobs: Reject hotkey bindings on Mouse1/Mouse2#13404mbokinala wants to merge 1 commit intoobsproject:masterfrom
mbokinala wants to merge 1 commit intoobsproject:masterfrom
Conversation
Hotkeys should not be bound on Mouse1/Mouse2 (left and right mouse buttons) since this will interrupt normal frontend clicks. The hotkeys UI prevents setting hotkeys for these two buttons, but it is still possible to load such hotkeys by manually editing scene collection JSON or by a third-party plugin calling obs_hotkey_load_bindings(). This commit prevents loading hotkeys on Mouse1/Mouse2 via any path. Fixes obsproject#13403.
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
This PR prevents loading hotkeys on Mouse1/Mouse2 by adding a guard in
create_binding().Motivation and Context
Hotkeys should not be bound on Mouse1/Mouse2 (left and right mouse buttons) since this will interrupt normal frontend clicks.
The hotkeys UI prevents setting hotkeys for these two buttons, but it is still possible to load such hotkeys by manually editing scene collection JSON or by a third-party plugin calling obs_hotkey_load_bindings().
This fixes issue #13403.
How Has This Been Tested?
Tested by adding hotkeys bound to Mouse1/Mouse2 in scene collection JSON:
Verified that the hotkeys do not show up in Settings > Hotkeys.
Also verified that hotkeys on non-blocked keys (e.g. Mouse3) are not affected.
Tested on MacOS 26.3.1 (a)
Types of changes
Checklist: