diff --git a/obs/data/locale/en-US.ini b/obs/data/locale/en-US.ini index 997423bc8..0c0dc76ca 100644 --- a/obs/data/locale/en-US.ini +++ b/obs/data/locale/en-US.ini @@ -361,6 +361,9 @@ Basic.AdvAudio.AudioTracks="Tracks" Basic.Settings.Hotkeys="Hotkeys" Basic.Settings.Hotkeys.Pair="Key combinations shared with '%1' act as toggles" +# basic mode hotkeys +Basic.Hotkeys.SelectScene="Switch to scene" + # hotkeys that may lack translation on certain operating systems Hotkeys.Insert="Insert" Hotkeys.Delete="Delete" diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 576328401..17360af07 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -918,6 +918,18 @@ void OBSBasic::AddScene(OBSSource source) item->setData(Qt::UserRole, QVariant::fromValue(OBSScene(scene))); ui->scenes->addItem(item); + obs_hotkey_register_source(source, "OBSBasic.SelectScene", + Str("Basic.Hotkeys.SelectScene"), + [](void *data, + obs_hotkey_id, obs_hotkey_t*, bool pressed) + { + auto potential_source = static_cast(data); + auto source = obs_source_get_ref(potential_source); + if (source && pressed) + obs_set_output_source(0, source); + obs_source_release(source); + }, static_cast(source)); + signal_handler_t *handler = obs_source_get_signal_handler(source); signal_handler_connect(handler, "item_add", OBSBasic::SceneItemAdded, this);