@@ -1137,33 +1137,33 @@ namespace platf {
11371137 }
11381138
11391139 void enable_mouse_keys () {
1140- // If there is no mouse connected, enable Mouse Keys to force the cursor to appear
1141- if (!GetSystemMetrics (SM_MOUSEPRESENT)) {
1142- BOOST_LOG (info) << " A mouse was not detected. Sunshine will enable Mouse Keys while streaming to force the mouse cursor to appear." ;
1143-
1144- // Get the current state of Mouse Keys so we can restore it when streaming is over
1145- previous_mouse_keys_state.cbSize = sizeof (previous_mouse_keys_state);
1146- if (SystemParametersInfoW (SPI_GETMOUSEKEYS, 0 , &previous_mouse_keys_state, 0 )) {
1147- MOUSEKEYS new_mouse_keys_state = {};
1148-
1149- // Enable Mouse Keys
1150- new_mouse_keys_state.cbSize = sizeof (new_mouse_keys_state);
1151- new_mouse_keys_state.dwFlags = MKF_MOUSEKEYSON | MKF_AVAILABLE;
1152- new_mouse_keys_state.iMaxSpeed = 10 ;
1153- new_mouse_keys_state.iTimeToMaxSpeed = 1000 ;
1154- if (SystemParametersInfoW (SPI_SETMOUSEKEYS, 0 , &new_mouse_keys_state, 0 )) {
1155- // Remember to restore the previous settings when we stop streaming
1156- enabled_mouse_keys = true ;
1157- } else {
1158- auto winerr = GetLastError ();
1159- BOOST_LOG (warning) << " Unable to enable Mouse Keys: " sv << winerr;
1160- }
1161- } else {
1162- auto winerr = GetLastError ();
1163- BOOST_LOG (warning) << " Unable to get current state of Mouse Keys: " sv << winerr;
1164- }
1140+ // If there is no mouse connected, enable Mouse Keys to force the cursor to appear
1141+ if (!GetSystemMetrics (SM_MOUSEPRESENT)) {
1142+ BOOST_LOG (info) << " A mouse was not detected. Sunshine will enable Mouse Keys while streaming to force the mouse cursor to appear." ;
1143+
1144+ // Get the current state of Mouse Keys so we can restore it when streaming is over
1145+ previous_mouse_keys_state.cbSize = sizeof (previous_mouse_keys_state);
1146+ if (SystemParametersInfoW (SPI_GETMOUSEKEYS, 0 , &previous_mouse_keys_state, 0 )) {
1147+ MOUSEKEYS new_mouse_keys_state = {};
1148+
1149+ // Enable Mouse Keys
1150+ new_mouse_keys_state.cbSize = sizeof (new_mouse_keys_state);
1151+ new_mouse_keys_state.dwFlags = MKF_MOUSEKEYSON | MKF_AVAILABLE;
1152+ new_mouse_keys_state.iMaxSpeed = 10 ;
1153+ new_mouse_keys_state.iTimeToMaxSpeed = 1000 ;
1154+ if (SystemParametersInfoW (SPI_SETMOUSEKEYS, 0 , &new_mouse_keys_state, 0 )) {
1155+ // Remember to restore the previous settings when we stop streaming
1156+ enabled_mouse_keys = true ;
1157+ } else {
1158+ auto winerr = GetLastError ();
1159+ BOOST_LOG (warning) << " Unable to enable Mouse Keys: " sv << winerr;
11651160 }
1161+ } else {
1162+ auto winerr = GetLastError ();
1163+ BOOST_LOG (warning) << " Unable to get current state of Mouse Keys: " sv << winerr;
1164+ }
11661165 }
1166+ }
11671167
11681168 void streaming_will_stop () {
11691169 // Demote ourselves back to normal priority class
0 commit comments