This version implements a different policy from v4:
You may look anywhere, but you may interact only with the locked window.
| Action | Locked window | Other window, same Space | Other Space |
|---|---|---|---|
| Move pointer | yes | yes | yes |
| Left/right/middle click | yes | blocked | blocked |
| Type / app keyboard shortcuts | yes | blocked | blocked |
| Vertical scroll | yes | yes | yes |
| Horizontal browser-navigation scroll | yes | blocked | blocked |
| Space swipe | yes | yes | yes |
| Ctrl-Left / Ctrl-Right Space switching | yes | yes | yes |
| Pinch / smart zoom / rotate outside target | — | blocked | blocked |
This means you can switch to a Space containing Skim, move the pointer over the PDF, and scroll through it. You cannot click Skim. You can switch to a Space containing Firefox and scroll a page, but you cannot click links, middle-click to open a tab, use Cmd-T, type into the browser, or use horizontal trackpad history navigation.
The clickable region is not cached. Every attempted click reads the locked
window's current win:frame(). If you resize or move the target window, its allowed
interaction rectangle follows immediately.
v5 also checks hs.spaces.windowSpaces() against hs.spaces.activeSpaceOnScreen().
If the locked window is on Desktop 1 while you are looking at Desktop 2, all clicks
are blocked even if the pointer happens to occupy the same screen coordinates as
the target window on Desktop 1.
v5 never moves your mouse, calls window:focus(), activates an application, or
forces you back to a Space.
./install.shThen:
Hammerspoon menu -> Reload Config
Verify:
focus-statusThe popup should contain:
5.0-interaction-lock
Use:
focus-lock 50The second optional argument is the countdown before locking:
focus-lock 50 6Ctrl + Option + Cmd + Esc
Manual unlock from the shell:
focus-unlockfocus-status reports whether the event tap is enabled and counts blocked clicks,
keys, deliberate horizontal scrolls, and application-level gestures.
If Firefox still reacts to an ordinary click while the status says zero blocked clicks, macOS/Hammerspoon is not delivering that click to the event tap. Check:
System Settings
-> Privacy & Security
-> Accessibility
-> Hammerspoon
and, if present on your macOS version:
System Settings
-> Privacy & Security
-> Input Monitoring
-> Hammerspoon
Then restart Hammerspoon and reload its config.
Clicking Mission Control/Desktop thumbnails is blocked because those are clicks outside the target. Switch Spaces using a trackpad Space swipe or Ctrl-Left/Right. This avoids creating a special exception that would also allow clicking arbitrary windows in Mission Control.
This is a concentration aid, not a security boundary.