diff --git a/src/modules/external_interface.rs b/src/modules/external_interface.rs index 8d16c8a..d763378 100644 --- a/src/modules/external_interface.rs +++ b/src/modules/external_interface.rs @@ -77,9 +77,9 @@ impl Hotkeys { }; } - pub fn change_scene(&self, _scene: Scenes, sub_scene: Option) { + pub fn change_scene(&self, scene: Scenes, sub_scene: Option) { let hotkey: &str; - if sub_scene.is_none() { + if scene == Scenes::Augmented { hotkey = self.hotkeys["hotkeys"]["obs"]["camera_scene_augmented"].as_str().unwrap() } else { hotkey = self.get_hotkey_from_scene(sub_scene.unwrap()) diff --git a/src/modules/message_handler.rs b/src/modules/message_handler.rs index 4090f51..6a7c83c 100644 --- a/src/modules/message_handler.rs +++ b/src/modules/message_handler.rs @@ -88,7 +88,6 @@ impl MessageHandler for StreamState { } }, StateUpdate::Scene(value) => { - hotkey_handler.change_scene(value, None); self.current_scene = value; if value == Scenes::Screen { @@ -98,6 +97,18 @@ impl MessageHandler for StreamState { self.timer_finished = true; } + match self.current_scene { + Scenes::Camera => { + hotkey_handler.change_scene(Scenes::Camera, Some(self.camera_sub_scene)); + }, + Scenes::Screen => { + hotkey_handler.change_scene(Scenes::Screen, Some(self.screen_sub_scene)); + }, + Scenes::Augmented => { + hotkey_handler.change_scene(Scenes::Augmented, None); + } + } + return (Some(update), None); }, StateUpdate::StreamSoundToggleOn(value) => {hotkey_handler.toggle_stream_sound(value); return (Some(update), None)},