upd
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user