This commit is contained in:
wildtail
2026-03-04 01:29:53 +03:00
parent a65681bca4
commit be8ca26bde
21 changed files with 216 additions and 110 deletions
+16 -19
View File
@@ -3,21 +3,12 @@ let uuid = null;
let ctxSettings = new Map();
const ACTION_MAP = {
"ru.wildtail.httpkeys.discord_micro_mute": {
actionId: "discord_micro_mute"
"ru.wildtail.httpkeys.globalmute": {
actionId: "globalmute"
},
"ru.wildtail.httpkeys.discord_mute": {
actionId: "discord_mute"
"ru.wildtail.httpkeys.tsmute": {
actionId: "tsmute"
},
"ru.wildtail.httpkeys.teamspeak_micro_mute": {
actionId: "teamspeak_micro_mute"
},
"ru.wildtail.httpkeys.talk_micro_mute": {
actionId: "talk_micro_mute"
},
"ru.wildtail.httpkeys.system_micro_mute": {
actionId: "system_micro_mute"
}
};
// подключение от D6
@@ -42,6 +33,17 @@ function connectElgatoStreamDeckSocket(inPort, inUUID, inRegisterEvent, inInfo)
const s = (payload && payload.settings) || { isOn: false };
ctxSettings.set(context, s);
setState(context, s.isOn ? 1 : 0);
const cfg = ACTION_MAP[action];
if (!cfg) return;
post("http://127.0.0.1:16888/press", {
actionUUID: action,
actionId: cfg.actionId,
toggleChanged: false,
isOn: !s.isOn,
});
return;
}
@@ -84,13 +86,8 @@ function handleKeyDown(action, context) {
post("http://127.0.0.1:16888/press", {
actionUUID: action,
actionId: cfg.actionId,
toggleChanged: prevState !== newState,
state: newState ? "on" : "off",
isOn: newState,
context: context,
timestamp: Date.now()
isOn: !newState,
});
}