From ea9cb3cb451c98c36bc28ca7dc9f9c28e6edcd32 Mon Sep 17 00:00:00 2001 From: filtered <176114999+webfiltered@users.noreply.github.com> Date: Thu, 21 Aug 2025 15:18:04 +1000 Subject: [PATCH] Allow Macs to zoom with Cmd + wheel (#5143) * Allow Mac to zoom with cmd+wheel * Only zoom when exact modifier pressed --- src/lib/litegraph/src/LGraphCanvas.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/litegraph/src/LGraphCanvas.ts b/src/lib/litegraph/src/LGraphCanvas.ts index 7f15d2ceb..36548ef11 100644 --- a/src/lib/litegraph/src/LGraphCanvas.ts +++ b/src/lib/litegraph/src/LGraphCanvas.ts @@ -3498,8 +3498,11 @@ export class LGraphCanvas // Detect if this is a trackpad gesture or mouse wheel const isTrackpad = this.pointer.isTrackpadGesture(e) + const isCtrlOrMacMeta = + e.ctrlKey || (e.metaKey && navigator.platform.includes('Mac')) + const isZoomModifier = isCtrlOrMacMeta && !e.altKey && !e.shiftKey - if (e.ctrlKey || LiteGraph.canvasNavigationMode === 'legacy') { + if (isZoomModifier || LiteGraph.canvasNavigationMode === 'legacy') { // Legacy mode or standard mode with ctrl - use wheel for zoom if (isTrackpad) { // Trackpad gesture - use smooth scaling