WarmUpTill / SceneSwitcher

An automation tool for OBS Studio
https://obsproject.com/forum/resources/automatic-scene-switching.395/
GNU General Public License v2.0
944 stars 73 forks source link

Hotkey Assignments are not Persisted across Restarts #48

Closed Bombe closed 3 years ago

Bombe commented 4 years ago

I reported this as https://github.com/obsproject/obs-studio/issues/3591 but apparently the correct place to report it is here, so… :)

I have assigned hotkeys (more specifically, F1 thru F4) to starting and stopping the Advanced Scene Switcher plugin using OBS’s setting. However, after exiting and restarting OBS those assignments are gone.

macOS: 10.13.6 OBS: 26.0.2. Advanced Scene Switcher: 1.7

The issue also occurs in Windows 10 (this is actually where I noticed it first) but I don’t have the exact version information for that system on hand.

Greetings,         Bombe

WarmUpTill commented 4 years ago

Thanks for reporting this problem! Have you tried using the hotkey at least once before exiting OBS? This should usually trigger the saving of the hotkey settings.

I might have to look at the hotkey functionality again as I added that quite while back and the current behavior is quite confusing.

Bombe commented 4 years ago

I had limited success with that method; it seems to work for a single hotkey for e.g. stopping the switcher but as soon as I use multiple hotkeys I can not get OBS to save any of them, they’re simply gone the next time I start it.

WarmUpTill commented 4 years ago

With b48fa56dc2bdcf2bfd93de261e525663ebfec86f the problems with hotkey settings not being persisted should be resolved. I would appreciate if you could give this a try.

A build should finish in a couple of minutes and will be available here (artifacts): https://github.com/WarmUpTill/SceneSwitcher/pull/49/checks

Bombe commented 4 years ago

Will check, thank you!

Bombe commented 3 years ago

I have tested it with both Windows and macOS, and neither single nor multiple keystrokes are persisted. It appears that any changes I make in the dialog are kept in memory but are not written to disk because after a restart they have reverted to the previous settings.

WarmUpTill commented 3 years ago

First of all: Thanks for the test!

Strange - my test setup must be different then.

So just setting or changing a hotkey, closing OBS and reopening OBS will cause it to revert it to the previous state, correct?

Does this only affect the hotkeys of the scene switchers or other hotkey as well? If the latter is the case could it possibly be a permissions issue in your file system?

With b48fa56 the hotkey should be saved to the same "settings file" as the rest of the settings of the plugin. This is done on every time the Advanced Scene Switcher UI is closed and on shutdown of OBS. The hotkeys are loaded and registered on initialization of the plugin.

Example location of the file on Windows would be: C:\Users\User\AppData\Roaming\obs-studio\basic\scenes\Untitled.json

In there you should find an entry similar to this: (This might differ of course depending on what you defined) "startHotkey": [ { "key": "OBS_KEY_7" } ], ... "stopHotkey": [], ... "toggleHotkey": [ { "key": "OBS_KEY_5" } ],

Is this the case for you?

Bombe commented 3 years ago

So just setting or changing a hotkey, closing OBS and reopening OBS will cause it to revert it to the previous state, correct?

Yes.

Does this only affect the hotkeys of the scene switchers or other hotkey as well? If the latter is the case could it possibly be a permissions issue in your file system?

Unlikely, because it happens in both Windows and macOS.

With b48fa56 the hotkey should be saved to the same "settings file" as the rest of the settings of the plugin. This is done on every time the Advanced Scene Switcher UI is closed and on shutdown of OBS. The hotkeys are loaded and registered on initialization of the plugin.

That could be an issue… in my tests I never opened the UI of the plugin, I only opened OBS’s settings dialog to change hotkey assignments, then closed OBS.

I will try again with opening and closing the plugin UI.

Bombe commented 3 years ago

Okay, I seem to have made some mistake somewhere… I started to doubt that the correct plugin version was installed so I checked the filesystem in ~/Library and indeed, that plugin was an old one. I extracted the plugin from the installer package and moved it to ~/Library/… only to now have the settings duplicated in OBS. I found the newer version in /Library which apparently is the directory the installer you linked above installs the plugin to. I removed that and now was back to the right number of hotkey configuration options for the plugin. :)

Also, it persists the hotkeys perfectly, even without opening the plugin’s UI. I will run another test with Windows (apparently I also managed to install the plugin to an incorrect location there) on the weekend, monday at the latest.

WarmUpTill commented 3 years ago

Ah, that's good news - thank you!

Bombe commented 3 years ago

Just tested it with Windows 10 and the same issue presented itself: the new DLL wasn’t copied. If you copy & paste the stuff from the compressed zip you get the dialog with “should I replace this” but you do not get the error dialog telling you you need admin rights, it just silently fails so the new version also wasn’t installed here. Once I fixed that, it simply works as expected.

Thank you!