Created
December 20, 2022 18:49
-
-
Save szhu/6086b9db2b4b0700045e43209a7e0cc2 to your computer and use it in GitHub Desktop.
HammerSpoon script for scroll to zoom with no modifiers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://forum.kicad.info/t/zoom-with-scroll-wheel-but-pan-with-trackpad-on-macos/11974 | |
figmaScrollToZoom = 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 "Figma" == 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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment