mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-30 17:58:37 +08:00
UI/importers: Ignore empty Streamlabs hotkeys
Ignore empty hotkeys when importing a scene collection file from Streamlabs Desktop.
This commit is contained in:
@@ -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"]},
|
||||
|
||||
Reference in New Issue
Block a user