-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
[QuickAccent] Adding Enable/Disable Hotkey #31413
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree
…________________________________
|
Help is welcome as I have a problem formatting src\settings-ui\Settings.UI\SettingsXAML\Views\PowerAccentPage.xaml |
Was it intentional to upgrade winrt? It causes a huge number of file changes. Ref #31396 |
No, it wasn't, as of one time trying to get into the repositories management system, I pulled again from the main branch which was at the time updated with that winrt thing. As such I reverted the changes at the end, if you know how to remove them entirely from the fork, I'd be thankful for you to tell me how. |
Okay. The merge includes changes from the main branch. |
It shouldn't have been implemented in my commit, however it got included as a merge, therefor I removed it |
If it were me, I think I would create a new, fresh branch. Then maybe cherry-pick the correct commits(s) to the new one. Or, sometimes when I think a branch/pr is getting too messy, I just start over. |
Yeah, this is weird. Why is there a revert? |
Thanks for opening this PR, by the way. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Mahfoudh94 , I've tried reverting your changes to fix the PR. Can you please look at https://github.com/microsoft/PowerToys/pull/31413/files and make sure that's the changes you've intended for the PR?
I'm quite sure that PowerToys.sln and Resources file have unintended changes. Can you please fix those?
So here comes the cherry-pick handy..., okay I'll give it a try, thanks
Don't mention it, it is thanks to you two for being here helping me as for why the revert, when the new code where implemented from the pull, it raises problems from "Audit deps.json files for all applications" step, you can check it on azure pipelines |
Actually, that "Audit deps.json files for all applications" step was caused by the Visual Studio 17.9 update in the CI. A fix has been done in main already, so I've merged main in, which should fix that. |
understood, now I should go and cherry-pick only those code changes I've done, then what? open a new pull request or is there a way to update this PR and take it from another branch? |
…" and "Hotkey change requires full restart to take effect"
0280686
to
16b7852
Compare
There it is, cleaned and cherry-picked. Hoping it all goes well. |
@jaimecbernardo, still waiting for your approval, and it happens there is a merge conflict because I added to the strings Resources.resw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First quick comments
@@ -9,6 +9,11 @@ namespace Microsoft.PowerToys.Settings.UI.Library | |||
{ | |||
public class PowerAccentProperties | |||
{ | |||
public static readonly HotkeySettings DefaultHotkeyValue = new HotkeySettings(true, false, false, false, 0x2D); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this translate to keys?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think we're missing a comment here to understand the defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is clear by the name of it, seeing it from my end ofc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, what I meant was: which keys are this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes 😅, it is (Win + INS)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mahfoudh94 , can you please add some code comments to avoid having magic numbers like this that are not understood? Thank you!
<ToggleSwitch x:Uid="ToggleSwitch" IsOn="{x:Bind ViewModel.IsEnabled, Mode=TwoWay}" /> | ||
</tkcontrols:SettingsCard> | ||
<tkcontrols:SettingsCard x:Uid="QuickAccent_Enable_Hotkey" HeaderIcon="{ui:FontIcon Glyph=}"> | ||
<controls:ShortcutControl MinWidth="{StaticResource SettingActionControlMinWidth}" HotkeySettings="{x:Bind Path=ViewModel.Hotkey, Mode=TwoWay}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path=
is unneeded :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you say so, let's get rid of it, it doesn't violate the guidelines anyway XD
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mahfoudh94 , can you please address this feedback? Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening the PR and cleaning it up. 😄
I've done a code review now. Can you please address the issues?
@@ -47,4 +47,7 @@ | |||
<ItemGroup> | |||
<None Include="packages.config" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
<Natvis Include="$(MSBuildThisFileDirectory)..\..\natvis\wil.natvis" /> | |||
</ItemGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this file being added?
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(CoreLibraryDependencies);%(AdditionalDependencies);winmm.lib</AdditionalDependencies> | ||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">winmm.lib;%(AdditionalDependencies)</AdditionalDependencies> | ||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies> | ||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">winmm.lib;$(CoreLibraryDependencies);%(AdditionalDependencies)</AdditionalDependencies> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't all these lines be merged into one?
if (m_enabled) | ||
{ | ||
disable(); | ||
PlaySound(TEXT("Media\\Windows Notify Messaging.wav"), NULL, SND_FILENAME | SND_ASYNC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it doesn't make sense to have the runner process play a sound.
Although I see that it can't likely be the QuickAccent process because it would need to play while exiting...
Can we turn this into a setting that's turned off by default? Always on top also has this as a setting, for example.
m_hotkey.alt = false; | ||
m_hotkey.shift = false; | ||
m_hotkey.ctrl = false; | ||
m_hotkey.key = 0x2D; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a comment here for what 0x2D means as well.
PowerToys.sln
Outdated
@@ -577,7 +577,6 @@ Global | |||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|ARM64.ActiveCfg = Debug|ARM64 | |||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|ARM64.Build.0 = Debug|ARM64 | |||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|x64.ActiveCfg = Debug|x64 | |||
{9412D5C6-2CF2-4FC2-A601-B55508EA9B27}.Debug|x64.Build.0 = Debug|x64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerToys.sln has lots of lines removed. I don't see a reason for this. Can you please fix it?
@jaimecbernardo |
Summary of the Pull Request
it adds the ability to enable/disable QuickAccent using a global hotkey without the need to enter the settings every time you don't need this utility (the clip is blocky because of the recorder + conversion to GIF)
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed