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

Find my mouse: set spotlight duration #20718

Open
nmdemarco opened this issue Sep 20, 2022 · 14 comments
Open

Find my mouse: set spotlight duration #20718

nmdemarco opened this issue Sep 20, 2022 · 14 comments
Labels
Cost-Small Small work item - 0-8 hours of work Help Wanted We encourage anyone to jump in on these and submit a PR. Product-Mouse Utilities Refers to the Mouse Utilities PowerToy

Comments

@nmdemarco
Copy link

nmdemarco commented Sep 20, 2022

Description of the new feature / enhancement

I should be able to set the duration the spotlight appears.

Scenario when this would be used?

There exists a delicate balance in the universe: Shake minimum distance. Too much distance, and you look like a crazed maniac shaking your mouse to find it. Too little distance, and your screen flashes like the WOPR learning that nobody wins at Global Thermonuclear War[^1]. If the spotlight duration could be specified, the interruption would be brief, and the cost for a lower Shake minimum distance would be reduced[^2].
[^1]https://www.theaceblackblog.com/2016/10/movie-review-wargames-1983.html
[^2]Yes, I realize the screen would flash more like the War Games movie scene, however, the visualization was too good to resist using the analogy.

Supporting information

No response

@nmdemarco nmdemarco added the Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams label Sep 20, 2022
@crutkas crutkas added Cost-Small Small work item - 0-8 hours of work Product-Mouse Utilities Refers to the Mouse Utilities PowerToy Help Wanted We encourage anyone to jump in on these and submit a PR. and removed Needs-Triage For issues raised to be triaged and prioritized by internal Microsoft teams labels May 11, 2023
@fredso90
Copy link
Contributor

fredso90 commented Oct 7, 2023

I would like to give this a go if possible?

@htcfreek
Copy link
Collaborator

htcfreek commented Oct 7, 2023

@fredso90
Feel free to open a PR. Your contribution is welcome. Thank you for your work on this.

@fredso90
Copy link
Contributor

@fredso90 Feel free to open a PR. Your contribution is welcome. Thank you for your work on this.

Screenshot 2023-10-18 211513

I have a question. Now I've made it so that Duration (ms) is an actual setting, but I can't seem to figure out how to update the labels. As seen in the screenshot above, the setting has no name on the settings screen :(
Do you happen to know how I can update the label(s)?

@htcfreek
Copy link
Collaborator

htcfreek commented Oct 18, 2023

@fredso90
It's hard to see the code problem without code. But if you copied an existing SettingsCard control, it is either linked by named properties (header, description) or the uid that references an entry in the resource file. (If it is done by the uid then the resource file contains entries like <uid name>.Header and <uid name>.Description.)

I hope that helps you.

@fredso90
Copy link
Contributor

@htcfreek
image

Here's what the SettingsCard looks like. I can't find the resource file, which, from your previous reply, should be where to find the Header and Description of all the labels.

I'm sorry if my questions are annoying. Just trying to learn :(

@htcfreek
Copy link
Collaborator

htcfreek commented Oct 19, 2023

@fredso90
You have to add an MouseUtils_FindMyMouse_DurationMs.Header entry and optional an MouseUtils_FindMyMouse_DurationMs.Description entry to the file https://github.com/microsoft/PowerToys/blob/main/src/settings-ui/Settings.UI/Strings/en-us/Resources.resw .

@fredso90
Copy link
Contributor

@htcfreek Thank you so much.

@fredso90
Copy link
Contributor

@htcfreek may I trouble you with yet another question?
I don't fully understand how the project is structured. What design pattern(s) and principles are being used?

More concretely, I wonder where I should implement the spotlight duration. I assume it's in the FindMyMouse.cpp file?

@htcfreek
Copy link
Collaborator

@htcfreek may I trouble you with yet another question?
I don't fully understand how the project is structured. What design pattern(s) and principles are being used?

More concretely, I wonder where I should implement the spotlight duration. I assume it's in the FindMyMouse.cpp file?

@jaimecbernardo
Can you please help here. I don't know the project structure too.

@jaimecbernardo
Copy link
Collaborator

Hi @fredso90,
As a summary, PowerToys main executable is the runner, which acts as a hub for every utility and provides each utility with common tools.
Each utility complies with the module interface in its own defined Module interface. For the case of FindMyMouse, the code is simple enough so all the code is contained in the module interface dll. You can find it in https://github.com/microsoft/PowerToys/tree/812b343776b5f0cbda734182e4996571803c35d8/src/modules/MouseUtils/FindMyMouse

The module interface per se is in https://github.com/microsoft/PowerToys/blob/812b343776b5f0cbda734182e4996571803c35d8/src/modules/MouseUtils/FindMyMouse/dllmain.cpp to deal with PowerToys integration and the Find My Mouse logic is in https://github.com/microsoft/PowerToys/blob/812b343776b5f0cbda734182e4996571803c35d8/src/modules/MouseUtils/FindMyMouse/FindMyMouse.cpp

By the way, GdiSonar and GdiSpotlight are not really used and are there from previous experiments. They're kept around mostly for reference. CompositionSpotlight is the SuperSonar implementation that's actually in use.

Hope this helps!

@fredso90
Copy link
Contributor

Thank you for your detailed reply. It does help. Now I know where to look and what code is relevant.

@InterClaw
Copy link

I wrote a duplicate request, so I am very much in favor of this suggestion. 👍

I did however also add another suggestion as part of it that it should not be required to stop moving the mouse completely for the spotlight to be able to go away. It should be enough to stop shaking it. If it can detect me shaking the mouse, it can also detect me having stopped shaking it and just moving the mouse normally.

@crutkas
Copy link
Member

crutkas commented Jan 8, 2024

@fredso90 please do.

@Jay-o-Way
Copy link
Collaborator

Duplicate of #16945

@Jay-o-Way Jay-o-Way marked this as a duplicate of #16945 Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cost-Small Small work item - 0-8 hours of work Help Wanted We encourage anyone to jump in on these and submit a PR. Product-Mouse Utilities Refers to the Mouse Utilities PowerToy
Projects
Status: No status
Development

No branches or pull requests

7 participants