Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Mouse Jump] - reduce winforms dependency, new thumbnail size settings, add shortcut keys - Ready For Review #25487

Merged
merged 13 commits into from
Apr 24, 2023

Conversation

mikeclayton
Copy link
Contributor

@mikeclayton mikeclayton commented Apr 13, 2023

Summary of the Pull Request

Makes a few improvements to Mouse Jump:

There's a summary below for each issue, and more details are available on each issue page...

1 - #25482 - reduce WinForms dependency

Added more Win32 API calls to remove the need for using the following built-in WinForms classes. This will make it easier to transition to a new presentation framework (WPF / WinUI3) at a later date if desired

  • System.Windows.Forms.Cursor
  • System.Windows.Forms.Screen
  • System.Windows.Forms.SystemInformation

This is the first 6 commits in this PR, down to (and including) d0489ae

2 - #25484 - improve popup responsiveness

If the form takes longer than 250ms to initialise it displays the preview with black rectangles and now renders screens incrementally one at a time to make it more responsive. (Behavior in 0.69.1 is to show the black rectangles but only refresh the thumbnail image once all remaining screenshots have been taken, so still feels a bit sluggish compared to this incremental approach)

FancyMouse.-.progressive.preview.v2.-.normal.mp4

3 - #24564 - customizable preview size

Added a Mouse Utils setting to specify the size of the preview image - default value is 1600 x 1200.

image

4 - #25069 - shortcuts for screen navigation

When the preview screen is visible the following keys will now move the cursor to the center of the appropriate screen.

Key Action
Key 1-9
NumPad 1-9
Move to center of numbered screen
"P" Move to center of primary screen
(not sure if this needs to be localizable?)
Left Arrow Move to center of previous screen (wraps around screens 1..N)
Right Arrow Move to center of next screen (wraps around screens 1..N)
Home Move to center of first screen
End Move to center of last screen

Screen numbers and sequence order for first / last / previous / next are per Display Settings

Future work:

  • Handle more than 9 screens?
  • When the preview image is visible, if a designated key is held down (e.g. ctrl), overlay screen numbers on the individual miniature screenshot images to help identify them (similar to the "Identify" button on the Display Settings dialog, but show the numbers on the preview image rather than as overlays on the actual screens themselves.

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@mikeclayton mikeclayton marked this pull request as ready for review April 18, 2023 19:50
@mikeclayton mikeclayton changed the title WIP - [Mouse Jump] - reduce WinForms dependency [Mouse Jump] - reduce winforms dependency, new thumbnail size settings, add shortcut keys - Ready For Review Apr 18, 2023
@mikeclayton
Copy link
Contributor Author

@jaimecbernardo @htcfreek @crutkas - just a courtesy ping to let you know this PR is ready for review (assuming the build works!)

@htcfreek
Copy link
Collaborator

image

@niels9001
For me the content dialogue feels a bit odd here. Any ideas how we can get this into the settings action content?

@crutkas crutkas added the Needs-Review This Pull Request awaits the review of a maintainer. label Apr 20, 2023
@jaimecbernardo jaimecbernardo self-assigned this Apr 24, 2023
Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mikeclayton ,
Great work! Thank you for the contribution!
I've done some in depth tests, including building an installer, and everything seems to be working great.
Code changes LGTM, too.

For future work, it makes sense to describe the new shortcuts in the Settings, but I don't think this needs to be part of this PR.

@jaimecbernardo
Copy link
Collaborator

The change suggested by @htcfreek can be part of another PR as well.

@jaimecbernardo jaimecbernardo merged commit fda75e4 into microsoft:main Apr 24, 2023
@mikeclayton
Copy link
Contributor Author

Fab, thanks.

I'll raise some issues for the "future work" suggestions once v70 has been released.

BLM16 pushed a commit to BLM16/PowerToys that referenced this pull request Jun 22, 2023
…cut keys(microsoft#25487)

* [Mouse Jump] - reorganise existing NativeMethods (microsoft#25482)

* Mouse Jump] - reorganise Helper classes / main form code (microsoft#25482)

* Mouse Jump] - replace use of System.Windows.Forms.Screen with Native Methods (microsoft#25482)

* Mouse Jump] - replace use of System.Windows.Forms.SystemInformation with Native Methods (microsoft#25482)

* [Mouse Jump] - replace use of System.Windows.Forms.Cursor with Native Methods (microsoft#25482)

* [Mouse Jump] - improve popup responsiveness (microsoft#25484)

* [Mouse Jump] - fixed spellchecker errors (microsoft#25484)

* [Mouse Jump] - add settings card for thumbnail size (microsoft#24564)

* [Mouse Jump] - shortcut keys to jump to centres of screens (microsoft#25069)

* [Mouse Jump] - fix spelling (microsoft#25069)

* [Mouse Jump] - fix spelling - numpad (microsoft#25069)

* [Mouse Jump] - updated "thumbnail size" settings text (microsoft#24564)
@mikeclayton mikeclayton deleted the dev/mikeclayton/mouse-jump branch September 5, 2023 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Review This Pull Request awaits the review of a maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants