Rant incoming, because I just happened to be dealing with this today.
I tried the push to talk binding method in sway, and found it was extremely fragile because if you press any modifier keys before releasing the button, the release binding won’t trigger and your mic will stay open. This is especially problematic for my use case as I use both my push to talk hotkey and my modifier buttons while gaming.
I just use a toggle mute hotkey instead of push-to-talk though. Just gotta remember to re-mute, and have a visual indicator for your mic status so you don’t accidentally leave it in the wrong state.
Another workaround is binding all possible combinations of modifier keys explicitly, and passing in --device-id so that the binding doesn’t consume the keypress and instead forwards it on to the application. This should perfectly emulate the behavior of an X-style global hotkey. With 4 mods (super, ctrl, shift, alt) and 2 bindings per combination there are 2^5 = 32 total bindings for each such hotkey. However there’s still no telling if the key-release event could be missed somehow and leave your mic open. I don’t know how reliable this method is.
If your binding is Alt+X, try pressing it down, tapping shift (press and release), then releasing X. The release keybind shouldn’t trigger.
I tried the workaround with all modifier combinations but this still happens, even if you bind Shift+(Your Binding). Pressing “shift” while the a chord is held prevents the release event from being handled.
Rant incoming, because I just happened to be dealing with this today.
I tried the push to talk binding method in sway, and found it was extremely fragile because if you press any modifier keys before releasing the button, the release binding won’t trigger and your mic will stay open. This is especially problematic for my use case as I use both my push to talk hotkey and my modifier buttons while gaming.
I just use a toggle mute hotkey instead of push-to-talk though. Just gotta remember to re-mute, and have a visual indicator for your mic status so you don’t accidentally leave it in the wrong state.
Another workaround is binding all possible combinations of modifier keys explicitly, and passing in --device-id so that the binding doesn’t consume the keypress and instead forwards it on to the application. This should perfectly emulate the behavior of an X-style global hotkey. With 4 mods (super, ctrl, shift, alt) and 2 bindings per combination there are 2^5 = 32 total bindings for each such hotkey. However there’s still no telling if the key-release event could be missed somehow and leave your mic open. I don’t know how reliable this method is.
Huh never encountered this, I’ll see if I can think of anything
If your binding is Alt+X, try pressing it down, tapping shift (press and release), then releasing X. The release keybind shouldn’t trigger.
I tried the workaround with all modifier combinations but this still happens, even if you bind Shift+(Your Binding). Pressing “shift” while the a chord is held prevents the release event from being handled.
Huh probably should make an issue on sway, repo