mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-29 20:44:20 +01:00
Fixed issue with xinput unplug routine on device removal
Related to issue #554
This commit is contained in:
parent
4d989bb5f0
commit
3dd88e481c
@ -2602,7 +2602,6 @@ namespace DS4Windows
|
||||
catch { dinputOnly[device] = false; missingSetting = true; }
|
||||
|
||||
bool oldUseDInputOnly = Global.useDInputOnly[device];
|
||||
Global.useDInputOnly[device] = dinputOnly[device];
|
||||
|
||||
// Only change xinput devices under certain conditions. Avoid
|
||||
// performing this upon program startup before loading devices.
|
||||
@ -2618,20 +2617,14 @@ namespace DS4Windows
|
||||
{
|
||||
if (dinputOnly[device] == true)
|
||||
{
|
||||
Global.useDInputOnly[device] = true;
|
||||
xinputPlug = false;
|
||||
xinputStatus = true;
|
||||
}
|
||||
else if (synced && isAlive)
|
||||
{
|
||||
Global.useDInputOnly[device] = false;
|
||||
xinputPlug = true;
|
||||
xinputStatus = true;
|
||||
}
|
||||
else if (!synced)
|
||||
{
|
||||
Global.useDInputOnly[device] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2995,12 +2988,12 @@ namespace DS4Windows
|
||||
int xinputIndex = control.x360Bus.FirstController + device;
|
||||
if (xinputResult)
|
||||
{
|
||||
dinputOnly[device] = false;
|
||||
Global.useDInputOnly[device] = false;
|
||||
AppLogger.LogToGui("X360 Controller # " + xinputIndex + " connected", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
dinputOnly[device] = true;
|
||||
Global.useDInputOnly[device] = true;
|
||||
AppLogger.LogToGui("X360 Controller # " + xinputIndex + " failed. Using DInput only mode", true);
|
||||
}
|
||||
}
|
||||
@ -3010,11 +3003,12 @@ namespace DS4Windows
|
||||
int xinputIndex = control.x360Bus.FirstController + device;
|
||||
if (xinputResult)
|
||||
{
|
||||
dinputOnly[device] = true;
|
||||
Global.useDInputOnly[device] = true;
|
||||
AppLogger.LogToGui("X360 Controller # " + xinputIndex + " unplugged", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Global.useDInputOnly[device] = false;
|
||||
AppLogger.LogToGui("X360 Controller # " + xinputIndex + " failed to unplug", true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user