Hotkeys using Control and Alt don't work reliably for scene selection

Hotkeys using Control and Alt don't work reliably for scene selection. They do seem to work reliably when a script uses them

I am seeing this on two different computers, and multiple scene collections. Both are OBS 27.0.1
I have hotkeys set to work only when OBS has the focus.

The attached ZIP has a simple 4-scene collection, HotMess.json, and an annotated log file. The scene collection has
- "Scene-1", showable by hotkeys 1, Numeric pad 1, or F3
- "Scene-2", showable by hotkeys 2, Numeric pad 2, or F4
- "Scene Ctrl-1", showable by hotkeys Ctrl-1, Ctrl-Numeric pad 1, or Ctrl-F3
- "Scene Ctrl-2", showable by hotkeys Ctrl-2, Ctrl-Numeric pad 2, or Ctrl-F4

Numbers and function keys alone switch scenes as expected.

Ctrl-and-key selects first one scene, and then immediately selects the other. Sometimes the "plain" one is shown first, and then the desired "Ctrl" scene,
so it looks OK (except that you sometimes see a flash from the "plain" one)

Sometimes the "Ctrl" scene is shown first, and then the "plain" one.

You can sometimes see the text from the other scene flash briefly.The log file shows both, a few msec apart. I have annotated the log file with the key that I pressed.

Exiting OBS and starting it again sometimes flips operation from Ctrl-first to plain-first.

I tried editing the .json to add
"control": false,
to the "plain" hotkeys, but it has no effect.
 

Attachments

  • HotMess.zip
    4.3 KB · Views: 14

FerretBomb

Active Member
This is because OBS uses hotkeys, not shortcuts.

If you bind a hotkey to '1', it will trigger immediately ANY time the 1 key is pressed for any reason, regardless of any modifier or other keys being pressed at the same time.
So you're getting a race condition where it's uncertain if the action bound to 1 or CTRL+1 activates second and overrides the first one, in the case of a scene switch. The same thing would happen if you had '1', 'CTRL+1', and 'CTRL+ALT+1' bound and hit the last one; it would trigger all three hotkeys at the same time.

To avoid this, don't bind anything to '1'. Bind CTRL+1 and ALT+1 instead, which require separate modifier keys. There is no way to specify 'no modifier keys' for a hotkey in OBS.
 
Thanks for the explanation. I am coming from Reaper, whch includes a huge list of pre-defined and user-assignable actions, shortcuts in your definition, so that was my paradigm coming in. (Reaper also warns you if your new assignment conflicts with an existing assignment, which is nice)

My problem is that I need a lot of key-driven actions, and there aren't enough keys that aren't used by OBS at least sometimes. Defining "A" as a hotkey is fine until you type an "A" while renaming a source etc. and the hotkey action fires AS WELL as the letter.

The numeric pad works pretty well as a set of hotkeys that don't cause unintended actions: if I want to type a "1" in a source name, I can use the number key above "Q" and avoid the number pad. But I guess that I am stuck with Alt-Num1 and Ctrl-Num1, leaving Num1 unused. (And yes, I know about Streamdeck and programmable keyboards)
 
Top