Skip to content

Add mouse button shortcuts for window actions - #1895

Merged
rxhanson merged 1 commit into
rxhanson:mainfrom
harshpatel333:feat/mouse-button-shortcuts
Oct 12, 2026
Merged

rxhanson merged 1 commit into
rxhanson:mainfrom
harshpatel333:feat/mouse-button-shortcuts

Conversation

@harshpatel333

@harshpatel333 harshpatel333 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Discussion: #1896

Picks up the mouse button idea from #1883 (comment).

What it does

Any window action's shortcut can now be a mouse button, such as the middle or side buttons, with or without modifier keys. Click the shortcut field and press the button, just like recording a key.

  • An assigned click goes only to Rectangle, so a browser won't also go back. Other buttons work as usual.
  • Mouse shortcuts turn off whenever keyboard shortcuts do: in ignored apps, on a locked screen, and while recording.
  • They act on the focused window. A new toggle in Behavior → Extras (off by default) makes them act on the window under the pointer instead.
  • Nothing is assigned by default, and Rectangle doesn't listen to mouse buttons until something is.

Notes

  • A mouse button is saved like a key, using key codes no key produces, so it fits the existing shortcut slot and config export with no format change.
  • For the pointer toggle, tiling, cycling, display moves and Todo now use the targeted window and leave focus alone. This also adds crash guards to Tile Active App and Cascade Active App.
  • The Todo and window list recorders now pause shortcuts while recording, like the others.
  • README has a new section.

Testing

  • 555 unit tests pass (Xcode 27.0, macOS 26.6.2), including new ones for button matching, swallowing, standing down, pointer targeting and config round-trips.
  • Tested by hand with a Logitech MX Vertical.

A window action's shortcut can now be a mouse button, such as the middle
or side buttons, with or without modifier keys. It's recorded in the
same field as a keyboard shortcut and saved like one, using key codes no
key produces, so it fits the existing shortcut slot and config export.

An assigned click goes only to Rectangle, and other buttons work as
usual. Mouse shortcuts turn off whenever keyboard shortcuts do: in
ignored apps, on a locked screen, and while recording. They act on the
focused window, or on the window under the pointer with a new toggle in
Behavior > Extras that is off by default.

For that toggle, tiling, cycling, display moves and Todo now use the
targeted window and leave focus alone, and Tile Active App and Cascade
Active App gain crash guards. The Todo and window list recorders now
pause shortcuts while recording, like the others.
@rxhanson

rxhanson commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Thanks, looks good at first glance. I'll be slowly but surely working through all of the pull requests and will hopefully get here soon!

@rxhanson
rxhanson merged commit fae35d1 into rxhanson:main Oct 12, 2026
1 check passed
@harshpatel333

Copy link
Copy Markdown
Contributor Author

Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants