From c3453ce2b89a63f24a4e66845d0dd323b22a8832 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 19 Jan 2019 17:25:53 -0800 Subject: [PATCH] Raise modifier keys on disconnect --- main.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/main.cpp b/main.cpp index 041e7a1..57d1c49 100644 --- a/main.cpp +++ b/main.cpp @@ -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;