moonlight-stream / moonlight-embedded

Gamestream client for embedded systems
https://github.com/moonlight-stream/moonlight-embedded/wiki
GNU General Public License v3.0
1.49k stars 324 forks source link

Avoid remote stuck keys on disconnect #771

Closed aandaluz closed 4 years ago

aandaluz commented 4 years ago

Description we have detected that with geforce experience 3.17, sometimes disconnecting from the remote host with the CTRL+ALT+SHIFT+Q leaves the keyboard stuck with key up state. For instance If you were streaming windows desktop and disconnect, sometimes double clicking will not work, as the local host will believe that the shift key is still pressed , so it will show the file properties dialog instead.

This is similar to what other people reported with protocols such as VNC in the past. See https://github.com/TigerVNC/tigervnc/issues/345 for instnace. Probably also related to https://github.com/irtimmer/moonlight-embedded/issues/766

If we connect a keyboard in the remote PC and press twice the ALT or CTrl keys, then we keyboard state is cleared and works fine again

Purpose This patch sends a keydown event after the CTRL+ALT+SHIFT+Q combination and waits 1 second for it to be processed, so that it never leaves the remote in a stuck keys state on disconnect.

irtimmer commented 4 years ago

Is merged with commit fe1c203b10dbc2f4fb1014eee8ddd59764f73f16 (after fixing indention)