-
Notifications
You must be signed in to change notification settings - Fork 49
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
Hotkey to cycle to the next power schema #32
Merged
petrroll
merged 1 commit into
petrroll:contribPRAfterActiveDev/cycleNextSchemaHotkey
from
objecttothis:cycle_next_schema_hotkey
Jun 1, 2021
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@petrroll The hotkey press is correctly switching the schema to the next power schema. The problem is that it doesn't show you what schema it switched you to. What I would like to do is modify
MainWindow.ToggleWindowVisibility()
to sort of act as a toast notification and disappear on its own after, say, 5 seconds. I can call `newHotKey.HotKeyFired += (this.MainWindow as MainWindow).ToggleWindowVisibility; as it currently is, and it shows the new schema, but it doesn't hide the window unless the user manually clicks somewhere on the screen. I played around with adding an optional timeout parameter but Visual Studio complained about that. I also couldn't figure out how to trigger the HideWithAnimation() function after the timeout period. I'm open to ideas about the best way to implement some sort of indicator notification of what power schema it just got changed to and then letting it disappear... if there is somewhere in the code where you are already doing this, please let me know.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.
Yeah, I vaguely remember the fly-out logic was somehow buggy w.r.t. to timeout parameters. The best way to approach it might be to use winrt API for proper notifications. I.e. instead of creating your own toast-like notification just use native Windows Notification API.
Not sure how much identity the current packaging schema provides and what's the state of invoking notifications without it, but remember that https://github.com/File-New-Project/EarTrumpet was doing something with winRT APIs so it might be a good place to start. Or you might wait until project reunion comes with notifications API (won't need app identity at all): https://github.com/microsoft/ProjectReunion