Implement keyboard-triggered shutdown #16
Draft
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.
This is a draft PR because I wasn't sure how you'd want to make this configurable, so the hotkey is currently hard-coded and I'll want to revise that, but it currently assigns Ctrl+Win+Alt+ScrollLock (i.e. Control+Command+Option+F14) to shut down the USB4VC.
I chose that key combo for three reasons:
Scroll Lock is quite possible the most unused key on the entire keyboard, with Mac OS just using F14 as something a user can assign their own meaning to and X11-based desktops not even mapping it to the modifier flag anymore, let alone in combination with modifiers being held down.
(On modern Windows, I believe it's only significant use is as something KVM switches can listen for a double-tap on, and, in my experience, USB-based ones that offer that feature (i.e. not the $20 USB/VGA ones off eBay you're likely to buy for your retro stuff) do it by listening for requests to change the Scroll Lock LED, not presses on the key itself.)
It uses three modifier keys, which makes it even more unlikely to collide with anything.
It's easy to remember because it's almost identical to the Mac OS "fast shutdown" key combo (Control+Command+Option+Power or Control+Command+Option+Eject) and, for PC users, it's easy to remember because it's just "Use three fingers on your left hand to press the three modifier keys that are in a row, then tap Scroll Lock".
However, if anyone has a problem with it that I'm missing, I have no problem with a different default.