mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-24 15:41:49 +01:00
Do not restart service when changing dinput option in profile
Only plug or unplug an xinput device as needed. Only perform when saving a profile.
This commit is contained in:
parent
d91f696b66
commit
18bb83ceef
@ -101,6 +101,27 @@ namespace DS4Windows
|
||||
catch { }
|
||||
}
|
||||
|
||||
public bool PlugXInputController(int index)
|
||||
{
|
||||
int xinputIndex = x360Bus.FirstController + index;
|
||||
LogDebug("Plugging in X360 Controller #" + xinputIndex);
|
||||
bool xinputResult = x360Bus.Plugin(index);
|
||||
useDInputOnly[index] = false;
|
||||
LogDebug("X360 Controller # " + xinputIndex + " connected");
|
||||
|
||||
return xinputResult;
|
||||
}
|
||||
|
||||
public bool UnplugXInputController(int index)
|
||||
{
|
||||
bool unplugResult = x360Bus.Unplug(index);
|
||||
int xinputIndex = x360Bus.FirstController + index;
|
||||
useDInputOnly[index] = true;
|
||||
LogDebug("X360 Controller # " + xinputIndex + " unplugged");
|
||||
|
||||
return unplugResult;
|
||||
}
|
||||
|
||||
public bool Start(object tempui, bool showlog = true)
|
||||
{
|
||||
if (x360Bus.Open() && x360Bus.Start())
|
||||
|
2
DS4Windows/DS4Forms/Options.Designer.cs
generated
2
DS4Windows/DS4Forms/Options.Designer.cs
generated
@ -1366,7 +1366,7 @@
|
||||
resources.ApplyResources(this.cBDinput, "cBDinput");
|
||||
this.cBDinput.Name = "cBDinput";
|
||||
this.cBDinput.UseVisualStyleBackColor = true;
|
||||
this.cBDinput.CheckedChanged += new System.EventHandler(this.cBDinput_CheckedChanged);
|
||||
this.cBDinput.CheckedChanged += new System.EventHandler(this.CBDinput_CheckedChanged);
|
||||
//
|
||||
// pBProgram
|
||||
//
|
||||
|
@ -1637,11 +1637,12 @@ namespace DS4Windows
|
||||
for (int i = 0; i < 4; i++)
|
||||
LoadProfile(i, false, Program.rootHub); // Refreshes all profiles in case other controllers are using the same profile
|
||||
|
||||
if (olddinputcheck != cBDinput.Checked)
|
||||
/*if (olddinputcheck != cBDinput.Checked)
|
||||
{
|
||||
root.BtnStartStop_Clicked(false);
|
||||
finishDInputChange();
|
||||
}
|
||||
*/
|
||||
|
||||
if (btnRumbleHeavyTest.Text == Properties.Resources.StopText)
|
||||
Program.rootHub.setRumble(0, 0, (int)nUDSixaxis.Value - 1);
|
||||
@ -1655,6 +1656,7 @@ namespace DS4Windows
|
||||
{
|
||||
int discon = getIdleDisconnectTimeout(device);
|
||||
int btCurrentIndex = btPollRateComboBox.SelectedIndex;
|
||||
|
||||
tempDev.queueEvent(() =>
|
||||
{
|
||||
tempDev.setIdleTimeout(discon);
|
||||
@ -1662,6 +1664,18 @@ namespace DS4Windows
|
||||
{
|
||||
tempDev.setBTPollRate(btCurrentIndex);
|
||||
}
|
||||
|
||||
if (olddinputcheck != cBDinput.Checked)
|
||||
{
|
||||
if (cBDinput.Checked)
|
||||
{
|
||||
Program.rootHub.UnplugXInputController(device);
|
||||
}
|
||||
else
|
||||
{
|
||||
Program.rootHub.PlugXInputController(device);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -2161,14 +2175,9 @@ namespace DS4Windows
|
||||
}
|
||||
}
|
||||
|
||||
private void cBDinput_CheckedChanged(object sender, EventArgs e)
|
||||
private void CBDinput_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DinputOnly[device] = cBDinput.Checked;
|
||||
if (!loading && device < 4)
|
||||
{
|
||||
root.BtnStartStop_Clicked(false);
|
||||
finishDInputChange();
|
||||
}
|
||||
}
|
||||
|
||||
private async void finishDInputChange()
|
||||
|
Loading…
Reference in New Issue
Block a user