From 0676502651df8ee094ba6dc4d8f14835a1f35498 Mon Sep 17 00:00:00 2001 From: bernspedras Date: Wed, 14 Apr 2021 18:09:19 -0300 Subject: [PATCH] Added experimental command to query xinput index It is a small optional cmd line option that would help in my case... its been working well for me. please consider merging --- DS4Windows/DS4Forms/MainWindow.xaml.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index facdb9f0c5..4571d03bda 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -1228,7 +1228,7 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, { // Name of the property to query from a profile or DS4Windows app engine propName = strData[2].ToLower(); - + if (propName == "profilename") { if (Global.useTempProfile[tdevice]) @@ -1267,6 +1267,15 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, propValue = App.rootHub.OutputslotMan.OutputSlots[tdevice].CurrentAttachedStatus.ToString(); else if (propName == "outputslotinputbound") propValue = App.rootHub.OutputslotMan.OutputSlots[tdevice].CurrentInputBound.ToString(); + else if (propName == "outputxinputindex") + { + var xboxOutput = (App.rootHub.OutputslotMan.OutputSlots[tdevice].OutputDevice as Xbox360OutDevice); + if(xboxOutput == null) + propValue = (-1).ToString(); + else + propValue = xboxOutput.cont.UserIndex.ToString(); + } + else if (propName == "apprunning") propValue = App.rootHub.running.ToString(); // Controller idx value is ignored, but it still needs to be in 1..4 range in a cmdline call