Option-Click hide behavior in 3D/VFX apps
Hello, world. As a 3D graphics/vfx creator I was always not happy about the default option+click behavior (into an inactive window) that would cause the currently active window to hide. In many 3D softwares, the option+click is the combo to start panning the viewport. But on the macOS it also hides the previously active window, which is just annoying if you have both windows next to each other and still need to see the contents of both of them at all times.
I've found another fellow artist who asked the same question, but unfortunately, no one provided any clues on how to really achieve it. I can not reply to it (since the question is too old):
Option-Click Hide Behavior (Super Annoyin… - Apple Community
So it seems that it's built in and there is no way to switch this off anywhere in the system settings. Anyway, today, I went to chatGPT and after a few hours of learning and trying possibilities, I have come up with a WORKING solution that I want to share with you and maybe see about suggestions.
Core of it is to install the Hammerspoon and then have a .lua script that modifies the behavior. I did thorough testing with my external monitor and debugged all of the problems that arose. So basically it checks the coordinates of where the mouse was clicked, then finds out what is the topmost window, and if it is the specific app (Maya in my case), then it applies this modified behavior.
Here is the .lua script:
local eventtap = hs.eventtap
local events = hs.eventtap.event.types
local mayaAppName = "Maya" -- Update if needed (e.g., "Autodesk Maya")
local function getTopmostAppUnderCursor()
local point = hs.mouse.getAbsolutePosition()
local windows = hs.window.orderedWindows()
for _, win in ipairs(windows) do
local frame = win:frame()
if point.x >= frame.x and point.x <= (frame.x + frame.w)
and point.y >= frame.y and point.y <= (frame.y + frame.h) then
local app = win:application()
return app and app:name() or "Unknown App", app
end
end
return nil, nil
end
-- Use Option+Click
local clickWatcher = eventtap.new({ events.leftMouseDown }, function(e)
local flags = e:getFlags()
-- Check if only Option (Alt) is held
if flags.alt and not (flags.cmd or flags.ctrl or flags.shift) then
local nameUnderCursor, appUnderCursor = getTopmostAppUnderCursor()
if nameUnderCursor == mayaAppName and not appUnderCursor:isFrontmost() then
appUnderCursor:activate()
end
end
return false -- Never block the click
end)
clickWatcher:start()
-- Emergency reload hotkey (keep it!)
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "R", function()
hs.reload()
hs.alert.show("🔁 Hammerspoon Reloaded")
end)
After putting this script inside the Hammerspoon config file, it is enough to just reload the config and it works as intended: you have your 3D app inactive and work in another window -> you option+click inside the 3D app -> it activates it, starts panning and DOESN'T HIDE the previously active window.
I don't know if this is the best place to share such a snippet (since I'm not asking for help exactly) but here are some relevant questions for the more experienced Apple devs and/or users:
1) Do you know of any working alternatives to this one?
2) My Macbook has Intel based CPU - is it possible that this will not work on M1-M4 chips?
3) Is there any way that regular folks can officially request a system feature, where this behavior could be modified? Because I'm pretty sure that many artists in the 3D/VFX industry would welcome it. I know I'll probably be cast off because this is very niche and job-specific but still I'm interested.
Right now I'm super happy that I've found a way to do it, even if it required such a workaround. Nice feature is that it was not about hacking into the system itself, meaning it should survive future OS updates.
Hopefully this finds anyone who might need it!
MacBook Pro 16″, macOS 14.0