Allow Ctrl+Q Shortcut to Close#60
Merged
thesupersonic16 merged 1 commit intohedge-dev:mainfrom Mar 17, 2025
Merged
Conversation
Member
|
On Windows For now I think this is fine, though there is a good chance the code will get replaced later on when the macOS PR is ready. |
thesupersonic16
approved these changes
Mar 17, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added the ability to use
Ctrl+Qto quit the application, which is common on Windows and Linux to close programs. These changes were tested on Arch Linux using JetBrains Rider.I am open to feedback on implementation, but based on how shortcuts are currently wired, I think I did this in a way that fits the current codebase.
I have worked with Qt in the past, and there is a concept of
KeySequences that have built-in shortcuts for some actions. AvalonUI seems to have something similar, but many examples seem to use XML (https://docs.avaloniaui.net/docs/concepts/input/binding-key-and-mouse). I am not familiar enough with the technology here to know if this is relevant to this project. 😅This is my first experience contributing to a C# codebase. I tried to follow the existing patterns that were in place. Let me know if I missed anything. Thanks!
EDIT: This would "work" on macOS, but on that platform, Cmd+Q is more commonly used. As there appears to be ongoing work to support macOS, I can add relevant support to check the correct modifier for macOS, but may need some guidance on how to check the current platform.