UI/importers: Ignore empty Streamlabs hotkeys

Ignore empty hotkeys when importing a scene collection file from
Streamlabs Desktop.
This commit is contained in:
prgmitchell
2023-08-10 00:29:34 -04:00
committed by Ryan Foster
parent b429d00440
commit 2a9b9c9298
+7
View File
@@ -22,6 +22,10 @@ using namespace json11;
static string translate_key(const string &sl_key)
{
if (sl_key.empty()) {
return "IGNORE";
}
if (sl_key.substr(0, 6) == "Numpad" && sl_key.size() == 7) {
return "OBS_KEY_NUM" + sl_key.substr(6);
} else if (sl_key.substr(0, 3) == "Key") {
@@ -172,6 +176,9 @@ static void get_hotkey_bindings(Json::object &out_hotkeys,
string key =
translate_key(binding["key"].string_value());
if (key == "IGNORE")
continue;
out_hotkey.push_back(
Json::object{{"control", modifiers["ctrl"]},
{"shift", modifiers["shift"]},