From 55921ca08f1eb40d34c176db260b8e10c2bc8eeb Mon Sep 17 00:00:00 2001 From: Nickiel12 <35903114+Nickiel12@users.noreply.github.com> Date: Sun, 2 Jan 2022 19:39:20 -0800 Subject: [PATCH] added new() constructor --- src/modules/external_interface.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/modules/external_interface.rs b/src/modules/external_interface.rs index 2fdb52d..608fa34 100644 --- a/src/modules/external_interface.rs +++ b/src/modules/external_interface.rs @@ -29,6 +29,12 @@ pub struct Hotkeys { } impl Hotkeys { + pub fn new(hotkeys: serde_json::Value) -> Self { + Hotkeys { + hotkeys + } + } + pub fn get_hotkey_from_scene(&self, scene: SubScenes) -> &str { match scene { SubScenes::CameraDefault => {self.hotkeys["hotkeys"]["obs"]["camera_scene_hotkey"].as_str().unwrap()}, @@ -40,6 +46,7 @@ impl Hotkeys { SubScenes::ScreenWithLowerRight => {self.hotkeys["hotkeys"]["obs"]["Screen_Bottom_Right"].as_str().unwrap()}, } } + pub fn send_obs(&self, hotkey: &str) { if cfg!(target_family = "windows") { Command::new(String::from(AHK_FILES_FOLDER) + "send_obs_back_to_propre.exe")