Skip to content

libobs: Reject hotkey bindings on Mouse1/Mouse2#13404

Open
mbokinala wants to merge 1 commit intoobsproject:masterfrom
mbokinala:fix/prevent-mouse1-mouse2-hotkeys
Open

libobs: Reject hotkey bindings on Mouse1/Mouse2#13404
mbokinala wants to merge 1 commit intoobsproject:masterfrom
mbokinala:fix/prevent-mouse1-mouse2-hotkeys

Conversation

@mbokinala
Copy link
Copy Markdown

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:

"hotkeys": {
       "libobs.mute": [{"key": "OBS_KEY_MOUSE1"}],
       "libobs.unmute": [{"key": "OBS_KEY_MOUSE2"}]
}

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

  • 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.
  • My code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

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.
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.

1 participant