Closed lorado closed 3 years ago
I updated code and made changes discussed on discord. Sorry, that I removed your QMaps, but using pointer in MidiHook
is a better place in my opinion, to store hotkey related data, as they belongs directly to the hook. And it turned out, it works well with obs_hotkey_t directly
So, I did revert my functions using OBS hotkey instances, and used your code with QMap. This solution indeed needs a little bit less code.
most of the changes within this PR is actually clang-format output...
Some summary outstanding points:
I changed action name from "Trigger_Shortcut_By_Name" to "Trigger_Shortcut". It just makes more sense!New classUPDATE: instead of creating custom class and having stress with pointers, I decided simply to use existing obs_hotkey_t pointers. It works now without issues.Hotkey
, which simply storesname
,description
andid
of OBS Hotkey.HotkeyModel
, which is used as model on QComboBox in dropdown hotkeys list.description
is shown, whilename
ist stored in the config. Config structure was not changed.obs_hotkey_register_frontend()
function, but hidingOBSBasic.*
hotkeys. I also found a way to fetch the context name of the hotkey, source/scene, if any (like in the hotkey settings section). But they are currently filtered by type, because these hotkeys are registered with a different function, therefore it has a different type.