PowerToys icon indicating copy to clipboard operation
PowerToys copied to clipboard

[ColorPicker]Add option to choose what clicking individual mouse buttons does

Open PesBandi opened this issue 8 months ago • 10 comments

Summary of the Pull Request

Enables the users to choose what left, right, and middle click does when color picker is open.

PR Checklist

  • [x] Closes: #39006
  • [x] Communication: I've discussed this with core contributors already
  • [x] Tests: All pass
  • [x] Localization: All end user facing strings can be localized
  • [x] Dev docs: No need
  • [x] New binaries: None
  • [x] Documentation updated: No need

Detailed Description of the Pull Request / Additional comments

Screenshot of the settings Adds option to choose from 3 click behaviors for each standard mouse button:

  • Pick color and open editor: Copies color to clipboard, saves it to the color history and opens the editor
  • Pick color and close: Copies color to clipboard, saves it to the color history and exits
  • Close: Closes color picker without copying the color

Pressing Enter or Space does what clicking the primary button would. Left and middle click actions execute on mouse down, right click on mouse up for reasons discussed previously (I can't find the conversation now) Default settings are chosen in such a way that very little or nothing changes by updating.

Validation Steps Performed

Tested:

  • Migrating settings from v2.0 to v2.1 (v1 to v2.1 not tested)
  • Settings page displays and saves settings correctly
  • Default settings load correctly
  • All three click actions do what they are supposed to
  • Activation behavior works as expected, doesn't affect click actions

PesBandi avatar Apr 22 '25 09:04 PesBandi

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.

Unrecognized words (3)

leftclickaction middleclickaction rightclickaction

These words are not needed and should be removed SHELLEXTENSION SHELLNEWVALUE SHGFIICON SHGFILARGEICON

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the [email protected]:PesBandi/PowerToys.git repository on the colorpicker-mouse-actions branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/67debf50669c7fc76fc8f5d7f996384535a72b77/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/14591754728/attempts/1'

Errors (2)

See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.

:x: Errors Count
:x: ignored-expect-variant 1
:warning: no-newline-at-eof 1

See :x: Event descriptions for more information.

If the flagged items are :exploding_head: false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it, try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

github-actions[bot] avatar Apr 22 '25 09:04 github-actions[bot]

I just realized that I used left/right click instead of primary/secondary everywhere. Should I change it?

PesBandi avatar Apr 22 '25 10:04 PesBandi

I just realized that I used left/right click instead of primary/secondary everywhere. Should I change it?

Yes even if it sounds awkward. In Windows settings you could switch it up so primary is no longer left and in code behind it uses primary / secondary.

I'd also call scroll wheel "middle"

crutkas avatar Apr 22 '25 23:04 crutkas

I like this too from a more power feature :)

crutkas avatar Apr 22 '25 23:04 crutkas

/azp run

crutkas avatar Apr 23 '25 04:04 crutkas

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Apr 23 '25 04:04 azure-pipelines[bot]

@check-spelling-bot Report

:red_circle: Please review

See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.

Unrecognized words (1)

secondarytclickaction

These words are not needed and should be removed secondaryclickaction SHELLEXTENSION SHELLNEWVALUE SHGFIICON SHGFILARGEICON

To accept these unrecognized words as correct and remove the previously acknowledged and now absent words, you could run the following commands

... in a clone of the [email protected]:PesBandi/PowerToys.git repository on the colorpicker-mouse-actions branch (:information_source: how do I use this?):

curl -s -S -L 'https://raw.githubusercontent.com/check-spelling/check-spelling/67debf50669c7fc76fc8f5d7f996384535a72b77/apply.pl' |
perl - 'https://github.com/microsoft/PowerToys/actions/runs/14627477406/attempts/1'

Errors (2)

See the :open_file_folder: files view, the :scroll:action log, or :memo: job summary for details.

:x: Errors Count
:x: ignored-expect-variant 2
:warning: no-newline-at-eof 1

See :x: Event descriptions for more information.

If the flagged items are :exploding_head: false positives

If items relate to a ...

  • binary file (or some other file you wouldn't want to check at all).

    Please add a file path to the excludes.txt file matching the containing file.

    File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.

    ^ refers to the file's path from the root of the repository, so ^README\.md$ would exclude README.md (on whichever branch you're using).

  • well-formed pattern.

    If you can write a pattern that would match it, try adding it to the patterns.txt file.

    Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines.

    Note that patterns can't match multiline strings.

github-actions[bot] avatar Apr 23 '25 20:04 github-actions[bot]

Everything functions as expected. Excellent work!

shuaiyuanxx avatar Apr 25 '25 07:04 shuaiyuanxx

/azp run

yeelam-gordon avatar Jun 10 '25 04:06 yeelam-gordon

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jun 10 '25 04:06 azure-pipelines[bot]