From 0723d49f5c9784dc6a12d62d341b3e8c318b1ea7 Mon Sep 17 00:00:00 2001 From: Davri <42148912+Davr1@users.noreply.github.com> Date: Thu, 27 Aug 2026 08:29:30 +0200 Subject: [PATCH] WebKeybinds: Re-add missing CTRL+, keybind (#4555) --- src/plugins/webKeybinds.web/index.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/plugins/webKeybinds.web/index.ts b/src/plugins/webKeybinds.web/index.ts index 98af85d42..9d88f6372 100644 --- a/src/plugins/webKeybinds.web/index.ts +++ b/src/plugins/webKeybinds.web/index.ts @@ -19,6 +19,7 @@ import { definePluginSettings } from "@api/Settings"; import { Devs, IS_MAC } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; +import { SettingsRouter } from "@webpack/common"; const settings = definePluginSettings({ @@ -64,6 +65,26 @@ export default definePlugin({ } ], + start() { + document.addEventListener("keydown", this.onKey); + }, + + stop() { + document.removeEventListener("keydown", this.onKey); + }, + + onKey(e: KeyboardEvent) { + const hasCtrl = e.ctrlKey || (e.metaKey && IS_MAC); + + // Cmd+, is a native shortcut on macos (Vesktop/src/main/mainWindow.ts) + const hasNativeShortcut = IS_VESKTOP && IS_MAC; + + if (hasCtrl && e.key === "," && !hasNativeShortcut) { + e.preventDefault(); + SettingsRouter.openUserSettings(); + } + }, + getBlockedKeybinds() { // Zoom shortcuts, allowing these would cause unpredictable zooming behavior on macos const blocked: string[] = ["mod+plus", "mod+minus", "mod+0"];