Skip to content

Fix: Behavior of hotkeys more like other apps now - #13363

Open
suogesi wants to merge 3 commits into
obsproject:masterfrom
suogesi:fix/13091
Open

suogesi wants to merge 3 commits into
obsproject:masterfrom
suogesi:fix/13091

Conversation

@suogesi

@suogesi suogesi commented Apr 27, 2026 •

Copy link
Copy Markdown
Contributor

Description

Hotkeys could trigger in unexpected way before:

  • When holding a hotkey combination, press a modifier key (Ctrl, Alt, Shift, Win for Windows, ⌘ for macOS, and super key for Linux) would trigger the hotkey.
  • A hotkey with modifier keys and a common key can be triggered no matter press modifier keys first or last. For most of apps, hotkey should only be triggered when modifier keys be pressed first.

Motivation and Context

#13091

How Has This Been Tested?

I ran it on my Windows 10 laptop and see it works.

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.

suogesi added 3 commits April 27, 2026 15:26
Remove the unnessary param `pressed`. Split conditions connected with
`||`.
Rename `modifiers_match` tl `input_match_modifiers`.
No need to pass binding pointer anymore.
Rewrite `handle_binding`. Also remove `modifiers_match` in
`obs_hotkey_binding` and add `pressing_key` for detecting if user press
common key before modifiers.

Previous code maybe tried to distingguish the order of keys input. It
actually didn't work. Rewrited `handle_binding` can check if user press
common key before modifiers and prevent hotkey being triggered.

Rewrited `handle_binding` also solve the problem that if you hold a
hotkey combination and press a modifier, when the modifier up, the
hotkey will be triggered.

Delete a assign in `inject_hotkey` because `modifiers_match` has been
removed. I trust it was just for pass the conditions in
`handle_binding`.
@WizardCM WizardCM added the kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. label May 1, 2026
@Warchamp7 Warchamp7 self-assigned this Oct 16, 2026
@Warchamp7
Warchamp7 self-requested a review October 16, 2026 06:51
@Warchamp7 Warchamp7 added area/ui-ux Anything to do with changes or additions to UI/UX elements. kind/breaking Breaking changes that need to be held for a major version release labels Oct 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ui-ux Anything to do with changes or additions to UI/UX elements. kind/breaking Breaking changes that need to be held for a major version release kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

Status: Ready For Review

Development

Successfully merging this pull request may close these issues.

3 participants