mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2025-02-17 00:16:20 +01:00
Some minor changes
This commit is contained in:
parent
05c94b677b
commit
2a20350b6b
@ -169,8 +169,15 @@ namespace DS4Windows
|
|||||||
|
|
||||||
running = true;
|
running = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
string logMessage = "Could not connect to Scp Virtual Bus Driver. Please check the status of the System device in Device Manager";
|
||||||
|
LogDebug(logMessage);
|
||||||
|
Log.LogToTray(logMessage);
|
||||||
|
}
|
||||||
|
|
||||||
ControllerStatusChanged(this);
|
ControllerStatusChanged(this);
|
||||||
|
runHotPlug = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -180,6 +187,8 @@ namespace DS4Windows
|
|||||||
if (running)
|
if (running)
|
||||||
{
|
{
|
||||||
running = false;
|
running = false;
|
||||||
|
runHotPlug = false;
|
||||||
|
|
||||||
if (showlog)
|
if (showlog)
|
||||||
LogDebug(Properties.Resources.StoppingX360);
|
LogDebug(Properties.Resources.StoppingX360);
|
||||||
|
|
||||||
@ -231,6 +240,7 @@ namespace DS4Windows
|
|||||||
ControllerStatusChanged(this);
|
ControllerStatusChanged(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runHotPlug = false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1228,6 +1228,8 @@ namespace DS4Windows
|
|||||||
{
|
{
|
||||||
case DS4Controls.LXNeg:
|
case DS4Controls.LXNeg:
|
||||||
case DS4Controls.LXPos:
|
case DS4Controls.LXPos:
|
||||||
|
{
|
||||||
|
if (MappedState.LX == 127)
|
||||||
{
|
{
|
||||||
if (dc == DS4Controls.LXNeg)
|
if (dc == DS4Controls.LXNeg)
|
||||||
{
|
{
|
||||||
@ -1239,11 +1241,14 @@ namespace DS4Windows
|
|||||||
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
||||||
MappedState.LX = axisMapping;
|
MappedState.LX = axisMapping;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DS4Controls.LYNeg:
|
case DS4Controls.LYNeg:
|
||||||
case DS4Controls.LYPos:
|
case DS4Controls.LYPos:
|
||||||
|
{
|
||||||
|
if (MappedState.LY == 127)
|
||||||
{
|
{
|
||||||
if (dc == DS4Controls.LYNeg)
|
if (dc == DS4Controls.LYNeg)
|
||||||
{
|
{
|
||||||
@ -1255,11 +1260,14 @@ namespace DS4Windows
|
|||||||
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
||||||
MappedState.LY = axisMapping;
|
MappedState.LY = axisMapping;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DS4Controls.RXNeg:
|
case DS4Controls.RXNeg:
|
||||||
case DS4Controls.RXPos:
|
case DS4Controls.RXPos:
|
||||||
|
{
|
||||||
|
if (MappedState.RX == 127)
|
||||||
{
|
{
|
||||||
if (dc == DS4Controls.RXNeg)
|
if (dc == DS4Controls.RXNeg)
|
||||||
{
|
{
|
||||||
@ -1271,11 +1279,14 @@ namespace DS4Windows
|
|||||||
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
||||||
MappedState.RX = axisMapping;
|
MappedState.RX = axisMapping;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DS4Controls.RYNeg:
|
case DS4Controls.RYNeg:
|
||||||
case DS4Controls.RYPos:
|
case DS4Controls.RYPos:
|
||||||
|
{
|
||||||
|
if (MappedState.RY == 127)
|
||||||
{
|
{
|
||||||
if (dc == DS4Controls.RYNeg)
|
if (dc == DS4Controls.RYNeg)
|
||||||
{
|
{
|
||||||
@ -1287,6 +1298,7 @@ namespace DS4Windows
|
|||||||
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
byte axisMapping = getXYAxisMapping2(device, key, cState, eState, tp, fieldMapping, true);
|
||||||
MappedState.RY = axisMapping;
|
MappedState.RY = axisMapping;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -185,6 +185,7 @@ namespace DS4Windows
|
|||||||
protected static Int32 m_IdleTimeout = 600000;
|
protected static Int32 m_IdleTimeout = 600000;
|
||||||
static string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
static string exepath = Directory.GetParent(Assembly.GetExecutingAssembly().Location).FullName;
|
||||||
public static string appdatapath;
|
public static string appdatapath;
|
||||||
|
public static bool runHotPlug = false;
|
||||||
public static string[] tempprofilename = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
|
public static string[] tempprofilename = new string[5] { string.Empty, string.Empty, string.Empty, string.Empty, string.Empty };
|
||||||
public static bool[] tempprofileDistance = new bool[5] { false, false, false, false, false };
|
public static bool[] tempprofileDistance = new bool[5] { false, false, false, false, false };
|
||||||
|
|
||||||
|
@ -893,12 +893,15 @@ namespace DS4Windows
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void WndProc(ref Message m)
|
protected override void WndProc(ref Message m)
|
||||||
|
{
|
||||||
|
if (runHotPlug)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
if (m.Msg == ScpDevice.WM_DEVICECHANGE)
|
||||||
{
|
{
|
||||||
Int32 Type = m.WParam.ToInt32();
|
Int32 Type = m.WParam.ToInt32();
|
||||||
|
|
||||||
lock (this)
|
lock (this)
|
||||||
{
|
{
|
||||||
Program.rootHub.HotPlug();
|
Program.rootHub.HotPlug();
|
||||||
@ -908,6 +911,7 @@ namespace DS4Windows
|
|||||||
catch { }
|
catch { }
|
||||||
if (m.Msg == WM_QUERYENDSESSION)
|
if (m.Msg == WM_QUERYENDSESSION)
|
||||||
systemShutdown = true;
|
systemShutdown = true;
|
||||||
|
}
|
||||||
|
|
||||||
// If this is WM_QUERYENDSESSION, the closing event should be
|
// If this is WM_QUERYENDSESSION, the closing event should be
|
||||||
// raised in the base WndProc.
|
// raised in the base WndProc.
|
||||||
|
@ -36,7 +36,11 @@ namespace DS4Windows
|
|||||||
// Sort Bluetooth first in case USB is also connected on the same controller.
|
// Sort Bluetooth first in case USB is also connected on the same controller.
|
||||||
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
hDevices = hDevices.OrderBy<HidDevice, ConnectionType>((HidDevice d) => { return DS4Device.HidConnectionType(d); });
|
||||||
|
|
||||||
for (int i = 0, devCount = hDevices.Count(); i < devCount; i++)
|
int devCount = hDevices.Count();
|
||||||
|
string devicePlural = "device" + (devCount == 0 || devCount > 1 ? "s" : "");
|
||||||
|
//Log.LogToGui("Found " + devCount + " possible " + devicePlural + ". Examining " + devicePlural + ".", false);
|
||||||
|
|
||||||
|
for (int i = 0; i < devCount; i++)
|
||||||
//foreach (HidDevice hDevice in hDevices)
|
//foreach (HidDevice hDevice in hDevices)
|
||||||
{
|
{
|
||||||
HidDevice hDevice = hDevices.ElementAt<HidDevice>(i);
|
HidDevice hDevice = hDevices.ElementAt<HidDevice>(i);
|
||||||
|
@ -19,6 +19,7 @@ namespace DS4Windows
|
|||||||
public byte Battery; // 0 for charging, 10/20/30/40/50/60/70/80/90/100 for percentage of full
|
public byte Battery; // 0 for charging, 10/20/30/40/50/60/70/80/90/100 for percentage of full
|
||||||
public double LSAngle; // Calculated bearing of the LS X,Y coordinates
|
public double LSAngle; // Calculated bearing of the LS X,Y coordinates
|
||||||
public double RSAngle; // Calculated bearing of the RS X,Y coordinates
|
public double RSAngle; // Calculated bearing of the RS X,Y coordinates
|
||||||
|
public static readonly int DEFAULT_AXISDIR_VALUE = 127;
|
||||||
|
|
||||||
public DS4State()
|
public DS4State()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user