PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[Fancy Zones] Middle click to toggle spanning multiple zones

Open BasitAli opened this issue 1 year ago • 3 comments

Middle click to toggle spanning multiple zones

PR Checklist

  • [x] Closes: #7925
  • [ ] Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • [ ] Tests: Added/updated and all pass
  • [ ] Localization: All end user facing strings can be localized
  • [ ] Dev docs: Added/updated
  • [ ] New binaries: Added on the required places
  • [ ] Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Separated middle mouse button taps from the SecondaryMouseButtonsHook so that it can be reused as a toggle for spanning multiple zones.

This allows for a mouse only way to pin a window to multiple zones which is only possible today by pressing the ctrl button.

Validation Steps Performed

Only tested this locally. I want to use this PR to gather thoughts and invite conversation about this.

BasitAli avatar May 20 '23 00:05 BasitAli

@microsoft-github-policy-service agree

BasitAli avatar May 20 '23 00:05 BasitAli

Have you considered using a different approach to solve this problem?

marie6644549799 avatar May 27 '23 22:05 marie6644549799

Have you considered using a different approach to solve this problem?

There's an active discussion at https://github.com/microsoft/PowerToys/issues/7925. There were two other solutions posted here,

  1. Use the secondary click to toggle between 3 states,

    • First Secondary Click: Activate Zone
    • Second Secondary Click: Activate Zone Spanning
    • Third Secondary Click: Deactivate Fancy Zones

    The drawback to this solution is the change in the way it operates currently.

  2. Once Fancy Zone is activated, Click and Hold the Secondary button to activate Zone spanning. On release of either Primary or Secondary click, the windows will be resized taking over the highlighted zones.

    I tried using this approach with a custom autohotkeys script, and while this solution worked mostly well, implementing it and thinking about the edge cases seemed a bit complex (releasing just the secondary click and holding on the primary click felt weird) .

BasitAli avatar May 29 '23 09:05 BasitAli

Besides the minor comments, the PR is good to go. Nice work!

SeraphimaZykova avatar Jun 12 '23 12:06 SeraphimaZykova

Thank you for your contribution @BasitAli!

SeraphimaZykova avatar Jun 13 '23 09:06 SeraphimaZykova

this is a great change. However, could we have an option to remap to some other key?

namakeingo avatar Jul 06 '23 13:07 namakeingo