-
-
Save raxigan/588bb3c97ec2a2a3b3042846fbf7fe51 to your computer and use it in GitHub Desktop.
disableTopScreenEdgeForDragging = hs.eventtap.new({ hs.eventtap.event.types.leftMouseDragged }, function(e) | |
local loc = e:location() | |
if loc.y == 0.0 then | |
hs.mouse.setAbsolutePosition({ x = loc.x, y = 0.01 }, | |
1337 -- a hack, do not remove | |
) | |
end | |
end) | |
disableTopScreenEdgeForDragging:start() |
This script disables mission control only when dragging a window to the top screen's edge. At the time of writing, macos didn't allow to disable this feature.
In terms of keyboard shortcuts you should be able to disable it somewhere in the system preferences. "e" as a shortcut for mission control is quite strange though and I doubt it's the default one.
Thanks for the additional info. Looks like I'll have to replace the keyboard.
This script now interferes with macOS Sequoia's window tiling system, meaning it prevents windows from filling the screen when dragging to the top edge.
I have made a workaround for this by adding a new event listener on left mouse up:
function fill()
hs.application.frontmostApplication():selectMenuItem({"Window", "Fill"})
end
function fillOnTopScreenDragging(e)
if e:location().y == 0.0 then
fill()
end
end
hookLeftMouseUp = hs.eventtap.new({hs.eventtap.event.types.leftMouseUp}, fillOnTopScreenDragging)
hookLeftMouseUp:start()
Thanks for your update @yrnehli. Do you know if the original issue with window dragging and mission control activation is still there? I stopped using hammerspoon completely a while ago and the problem seems to be gone (at least for me). Not sure if it got fixed in some os update or I changed sth in my settings in the meanwhile. My last investigation of this issue was more than 2 years ago.
@raxigan Yeah, the original issue is still present - you have to drag quite quickly and violently to the top of the screen but it still triggers mission control. It annoyingly interferes with the new native macOS tiling system...
The only other tool I've seen where you can disable this is BetterSnapTool.
Thanks for your response.
Some context:
Whenever I press the
e
key on my keyboard, mission control is triggered. In system settings I've disabled all shortcuts related to mission control but still gets triggered whene
is pressed (although it still types correctly and without issue).There's a possibility that it's a hardware (keyboard) problem thus I'm trying to find a way to disable mission control before resorting to a keyboard replacement.
Additional info:
Ive got Hammerspoon version 1..0.0 installed. Ive no external monitors. I've added the code to init.lua file and saved it. Accessibility access is enabled and have Hammerspoon to start upon login. I've rebooted my Macbook pro. No errors in the logs. When I press
e
on my keyboard mission control still gets triggered.Thanks for trying to help.