fix: hotkeys setting from pwsp-gui (#56)

* refactor: do not overwrite incorrect hotkeys config

* fix: hotkeys not saved via pwsp-gui
This commit is contained in:
Tarasov Aleksandr
2026-04-12 17:05:10 +03:00
committed by GitHub
parent cb56cb3a04
commit 42c0170044
6 changed files with 119 additions and 26 deletions
+12
View File
@@ -208,6 +208,18 @@ impl Request {
pub fn clear_hotkey_key(slot: &str) -> Self {
Request::new("clear_hotkey_key", vec![("slot", slot)])
}
pub fn set_hotkey_action_and_key(slot: &str, action: &Request, key_chord: &str) -> Self {
let action_json = serde_json::to_string(action).unwrap_or_default();
Request::new(
"set_hotkey_action_and_key",
vec![
("slot", slot),
("action", &action_json),
("key_chord", key_chord),
],
)
}
}
#[derive(Default, Debug, Clone, Serialize, Deserialize)]