mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-27 17:11:48 +01:00
Fixed a couple of issue with gyro mappings
This commit is contained in:
parent
ca2074d76f
commit
9e153fff97
@ -95,11 +95,13 @@ namespace DS4Windows
|
||||
buttons[(int)DS4Controls.TouchUpper] = tp != null ? tp.upperDown : false;
|
||||
buttons[(int)DS4Controls.TouchMulti] = tp != null ? tp.multiDown : false;
|
||||
|
||||
gryodirs[(int)DS4Controls.GyroXNeg] = exposeState.getGyroX();
|
||||
gryodirs[(int)DS4Controls.GyroXPos] = exposeState.getGyroX();
|
||||
int gyroX = exposeState.getGyroX();
|
||||
gryodirs[(int)DS4Controls.GyroXPos] = gyroX;
|
||||
gryodirs[(int)DS4Controls.GyroXNeg] = gyroX;
|
||||
|
||||
gryodirs[(int)DS4Controls.GyroZPos] = exposeState.getGyroZ();
|
||||
gryodirs[(int)DS4Controls.GyroZPos] = exposeState.getGyroZ();
|
||||
int gyroZ = exposeState.getGyroZ();
|
||||
gryodirs[(int)DS4Controls.GyroZPos] = gyroZ;
|
||||
gryodirs[(int)DS4Controls.GyroZNeg] = gyroZ;
|
||||
|
||||
swipedirs[(int)DS4Controls.SwipeLeft] = tp != null ? tp.swipeLeftB : (byte)0;
|
||||
swipedirs[(int)DS4Controls.SwipeRight] = tp != null ? tp.swipeRightB : (byte)0;
|
||||
|
@ -2619,13 +2619,14 @@ namespace DS4Windows
|
||||
{
|
||||
bool sOff = isUsingSAforMouse(device);
|
||||
bool safeTest = false;
|
||||
if (control == DS4Controls.GyroXNeg || control == DS4Controls.GyroZNeg)
|
||||
|
||||
switch (control)
|
||||
{
|
||||
safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67;
|
||||
}
|
||||
else
|
||||
{
|
||||
safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67;
|
||||
case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break;
|
||||
case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break;
|
||||
case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break;
|
||||
case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
result = !sOff ? safeTest : false;
|
||||
@ -2780,13 +2781,14 @@ namespace DS4Windows
|
||||
{
|
||||
bool sOff = isUsingSAforMouse(device);
|
||||
bool safeTest = false;
|
||||
if (control == DS4Controls.GyroXNeg || control == DS4Controls.GyroZNeg)
|
||||
|
||||
switch (control)
|
||||
{
|
||||
safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67;
|
||||
}
|
||||
else
|
||||
{
|
||||
safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67;
|
||||
case DS4Controls.GyroXPos: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] > 67; break;
|
||||
case DS4Controls.GyroXNeg: safeTest = SXSens[device] * fieldMap.gryodirs[controlNum] < -67; break;
|
||||
case DS4Controls.GyroZPos: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] > 67; break;
|
||||
case DS4Controls.GyroZNeg: safeTest = SZSens[device] * fieldMap.gryodirs[controlNum] < -67; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
result = !sOff ? safeTest : false;
|
||||
@ -3086,41 +3088,45 @@ namespace DS4Windows
|
||||
double SZD = getSZDeadzone(device);
|
||||
bool sOff = isUsingSAforMouse(device);
|
||||
|
||||
if (control == DS4Controls.GyroXNeg || control == DS4Controls.GyroZNeg)
|
||||
switch (control)
|
||||
{
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] < -SXD * 10)
|
||||
case DS4Controls.GyroXPos:
|
||||
{
|
||||
if (alt)
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] > SXD * 10)
|
||||
{
|
||||
result = (byte)Math.Min(255, 127 + SXSens[device] * -fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (byte)Math.Max(0, 127 - SXSens[device] * -fieldMap.gryodirs[controlNum]);
|
||||
if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else result = falseVal;
|
||||
break;
|
||||
}
|
||||
else
|
||||
case DS4Controls.GyroXNeg:
|
||||
{
|
||||
result = falseVal;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] > SXD * 10)
|
||||
{
|
||||
if (alt)
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] < -SXD * 10)
|
||||
{
|
||||
result = (byte)Math.Min(255, 127 + SXSens[device] * fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (byte)Math.Max(0, 127 - SXSens[device] * fieldMap.gryodirs[controlNum]);
|
||||
if (alt) result = (byte)Math.Min(255, 127 + SXSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SXSens[device] * -fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else result = falseVal;
|
||||
break;
|
||||
}
|
||||
else
|
||||
case DS4Controls.GyroZPos:
|
||||
{
|
||||
result = falseVal;
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] > SZD * 10)
|
||||
{
|
||||
if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else return falseVal;
|
||||
break;
|
||||
}
|
||||
case DS4Controls.GyroZNeg:
|
||||
{
|
||||
if (!sOff && fieldMap.gryodirs[controlNum] < -SZD * 10)
|
||||
{
|
||||
if (alt) result = (byte)Math.Min(255, 127 + SZSens[device] * -fieldMap.gryodirs[controlNum]); else result = (byte)Math.Max(0, 127 - SZSens[device] * -fieldMap.gryodirs[controlNum]);
|
||||
}
|
||||
else result = falseVal;
|
||||
break;
|
||||
}
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user