Skip to content

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

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

Fix: Behavior of hotkeys more like other apps now#13363
suogesi wants to merge 3 commits intoobsproject:masterfrom
suogesi:fix/13091

Conversation

@suogesi
Copy link
Copy Markdown

@suogesi suogesi commented Apr 27, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants