rkvm
rkvm copied to clipboard
Release keys pressed when switching clients
Currently when you switch client while having multiple keys set as combo, it will keep those keys pressed until you press them again. This is causing issues in many situations.
This patch causes server to send release event to all currently pressed keys from combo when client is changed.
PS: I removed TODO commend as I imagine it is about this exact issue
Nice, I was trying to fix some similar with https://github.com/htrefil/rkvm/pull/14/. Maybe we should not only release all the keys in the combo on the old client, but also press all the keys on the new client? I just pushed https://github.com/evan-goode/rkvm/commit/e7c08a49160004dbe0f8761fae9fddfcfbb0ceb7 which does that, borrowing some of your code. The use case for this is as follows:
- Say you have switch bound to Super + A
- Hold Super, then hit A to switch from client 0 to client 1
- Currently, only the A keydown would be sent to client 1, but it would be nice if client 1 also got a Super keydown so you could proceed to do other Super+key shortcuts on client 1 without re-pressing Super.
Imo repressing key on next client isn't desired in most cases, if your combo contains only modifier keys, it might be fine, but any other key could cause undesired behavior.
Fixed in 0.3.0. Thank you for your MR though.