Skip to content

Allow Ctrl+Q Shortcut to Close#60

Merged
thesupersonic16 merged 1 commit intohedge-dev:mainfrom
sonic2kk:ctrl-q-shortcut
Mar 17, 2025
Merged

Allow Ctrl+Q Shortcut to Close#60
thesupersonic16 merged 1 commit intohedge-dev:mainfrom
sonic2kk:ctrl-q-shortcut

Conversation

@sonic2kk
Copy link
Copy Markdown
Contributor

@sonic2kk sonic2kk commented Mar 16, 2025

Added the ability to use Ctrl+Q to 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.

@thesupersonic16
Copy link
Copy Markdown
Member

On Windows Ctrl + Q doesn't seem common, almost all software I use does not respond to it or does not treat it as quitting.
On macOS, I believe ⌘ is bound to the Meta key. I do not own an OSX machine to test that.
On my KDE Linux machine it seems to work on most software I have.

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 thesupersonic16 merged commit c6f97ff into hedge-dev:main Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants