From 2a9b9c929865499d6ef347b60e90dab677171d6e Mon Sep 17 00:00:00 2001 From: prgmitchell <86465454+prgmitchell@users.noreply.github.com> Date: Thu, 10 Aug 2023 00:29:34 -0400 Subject: [PATCH] UI/importers: Ignore empty Streamlabs hotkeys Ignore empty hotkeys when importing a scene collection file from Streamlabs Desktop. --- UI/importers/sl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/UI/importers/sl.cpp b/UI/importers/sl.cpp index 26c260a64..21c0e8da2 100644 --- a/UI/importers/sl.cpp +++ b/UI/importers/sl.cpp @@ -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"]},