Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion companion-bridge/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,16 @@ const { WebSocketServer } = require("ws");
const PORT = 6969;
const pressedKeys = new Set();
const ToggleBindings = new Map([
[61010, "TOGGLE_MUTE"],
[UiohookKey.Insert, "TOGGLE_MUTE"],
[3666, "TOGGLE_MUTE"],
[UiohookKey.Numpad0, "TOGGLE_MUTE"],
[82, "TOGGLE_MUTE"],
[60999, "TOGGLE_DEAFEN"],
[UiohookKey.Home, "TOGGLE_DEAFEN"],
[UiohookKey.Numpad7, "TOGGLE_DEAFEN"]
[3655, "TOGGLE_DEAFEN"],
[UiohookKey.Numpad7, "TOGGLE_DEAFEN"],
[71, "TOGGLE_DEAFEN"]
]);

const wss = new WebSocketServer({ host: "127.0.0.1", port: PORT });
Expand Down
5 changes: 2 additions & 3 deletions src/userplugins/customkeybinds/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,15 +133,14 @@ export default definePlugin({
clearReconnectTimer();
bridgeSocket?.close();
bridgeSocket = null;
connectBridge();

if (!Native) {
showToast("CustomKeybinds companion server auto-start is only available on desktop.", Toasts.Type.FAILURE);
return;
}

void Native.startCompanionServer().then(() => {
connectBridge();
}).catch(error => {
void Native.startCompanionServer().catch(error => {
logger.error("Failed to start companion bridge:", error);
showToast(
error instanceof Error ? error.message : "Failed to start the CustomKeybinds companion server.",
Expand Down
Loading