Raise modifier keys on disconnect

This commit is contained in:
Cameron Gutman 2019-01-19 17:25:53 -08:00
parent 6729bb64f8
commit c3453ce2b8

View File

@ -80,6 +80,14 @@ void* MoonlightInstance::StopThreadFunc(void* context) {
// not be invoked during LiStartConnection.
pthread_join(g_Instance->m_ConnectionThread, NULL);
// Force raise all modifier keys to avoid leaving them down after disconnecting
LiSendKeyboardEvent(0xA0, KEY_ACTION_UP, 0);
LiSendKeyboardEvent(0xA1, KEY_ACTION_UP, 0);
LiSendKeyboardEvent(0xA2, KEY_ACTION_UP, 0);
LiSendKeyboardEvent(0xA3, KEY_ACTION_UP, 0);
LiSendKeyboardEvent(0xA4, KEY_ACTION_UP, 0);
LiSendKeyboardEvent(0xA5, KEY_ACTION_UP, 0);
// Not running anymore
g_Instance->m_Running = false;