Zoom with scroll wheel, but pan with trackpad on macOS?

I usually have a (non-apple) mouse and a magic trackpad on my machines. While using the mouse, muscle memory dictates that the scroll wheel zooms, while clicking and dragging the middle mouse button pans, like in many other CAD packages. However, zooming on the trackpad is neither very useful nor smooth enough for me. I like the panning behaviour, though, and muscle memory agrees with panning on the trackpad, like in any other program.
Is there a way to make the trackpad behave like the “Use trackpad for panning” pref is enabled, but make the scroll wheel zoom, like that pref is disabled?

Edit:
I can no longer reply because the topic has been closed. I recently managed to get the behaviour I wanted with Hammerspoon using the following config:

kicadScrolling = hs.eventtap.new({hs.eventtap.event.types.scrollWheel}, function(e)
	-- Trackpad scroll events are continuous, mouse scroll events are not.
	if 0 == e:getProperty(hs.eventtap.event.properties.scrollWheelEventIsContinuous) then
		local front = hs.application.frontmostApplication()
		if "KiCad" == front:name() then
			local title = front:focusedWindow():title()
			if "Eeschema" == title:sub(0, 8) or "Pcbnew" == title:sub(0, 6) then
				local flags = e:getFlags()
				flags['cmd'] = true
				e:setFlags(flags)
			--else
				--print(title)
			end
		end
	end
end):start()

This needs “Use trackpad for panning” enabled and automatically adds the Cmd modifier to scroll events from the mouse wheel, so you can pan with the trackpad and zoom with the mouse!

2 Likes

Which Kicad version are you using and what canvas?

I use a MacBookPro (trackpad and Logitech Mouse) and a iMac with a MagicMouse with Kicad 5. On both I am using the ‘Modern Toolset’ - previously known as the GAL Canvas, with ultra quality sub pixel antialiasing set in the render preferences. I have no problems with panning or zooming using the trackpad - two finger swipe to pan and pinch to zoom. You may need to adjust your trackpad settings but on my MBP it is extremely smooth, controllable and quick with absolutely no jumping around or rendering problems. In pcbnew, set the pan settings in the preferences;
44
[You also need to set preferences in Eeschema for consistent behaviour]

Using the mouse is slightly less intuitive and is not as smooth, but scroll will pan up/down, cmd-scroll will zoom and shift-scroll will pan L/R. Holding the scroll wheel down and moving the mouse will pan in any direction.

If you need more flexibility in allocating gestures, you might need to look at a application like Better Touch Tool (https://folivora.ai) which can allow you to reallocate buttons and mouse clicks to better suit your way of working. (I have no affiliation other than as a user).

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.