feat: Independent modifier keys and mouse button for resize - #119
feat: Independent modifier keys and mouse button for resize#119supagroova wants to merge 3 commits into
Conversation
Add EMRMoveResizeTest (14 tests) covering singleton behavior, property storage, resize sections, and state lifecycle. Add EMRAppDelegateTest (14 tests) covering the CGEvent callback logic including modifier matching, mouse button routing, conflict resolution, resize-only mode, and middle-click configuration. Update project.pbxproj to include both new test files in the test target.
Move the XCTest detection guard before the AXIsProcessTrustedWithOptions call so the system accessibility modal dialog is never triggered when running tests. Previously the guard only skipped exit(1) after the prompt had already appeared, blocking the test runner. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@dmarcotte, I would love to see this feature included in the next build. When do you expect to be able to take a look at this? Anything I could help with to expedite the review? |
|
Thanks for sending this along, @supagroova. And nice work on Zooom3! Anyone who is waiting on this feature may want to check out Zooom3. @supagroova did some really nice work to enhance Easy Move+Resize to work more like he is used to. This is a delightfully thematic extension of this project :) Easy Move+Resize itself was born out of a desire to port Linux behavior I no longer had access to, and also, in its original form, grew out of another another project called Afloat. @orditeck I'm hoping to incorporate this before too long, though like I said, it's worth a look at @supagroova's Zooom3 which may be exactly what you want without the wait. |
Adds the ability to configure Move and Resize independently — each with their own modifier keys and mouse button — so users can resize with left-click + a different modifier combination instead of requiring right-click.
Closes #69
Motivation
The now-defunct Zooom/2 had this ability, and as noted in #69, requiring right-click for resize is awkward on a Mac trackpad. This PR brings the same flexibility: for example, you can set Cmd+Ctrl+Left-click to move and Cmd+Alt+Left-click to resize.
What changed
Preferences — New independent settings for resize modifier keys and mouse button (Left/Right/Middle), with conflict detection when Move and Resize have identical config. Existing user preferences are automatically migrated on first launch (modifier keys copied to resize, the old MiddleClickResize toggle converted to the new mouse button setting). Migration is version-gated and runs only once.
Callback logic — The CGEvent callback now matches Move and Resize independently based on their separate modifier flags and mouse button. When both match (conflict), resize wins. A new isResizing property on EMRMoveResize tracks which operation is active during drag.
Menu UI — The old shared modifier toggles are replaced with programmatically-built Move and Resize sections, each with their own modifier key checkboxes and mouse button submenu (Left/Right/Middle). A conflict warning appears when both operations have identical settings. "Resize only" greys out the Move section.
Tests — 49 unit tests covering preferences, callback logic, and model state. The XCTest guard skips the accessibility prompt so tests run without user interaction.
Default behavior is unchanged
Move = Cmd+Ctrl on Left-click, Resize = Cmd+Ctrl on Right-click — same as before.
Screenshot
