Skip to content

Commit

Permalink
disable all buttons for X52 throttle and logitech stick
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjarv committed Feb 23, 2018
1 parent 3ab59f8 commit 82ba1bb
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 104 deletions.
197 changes: 99 additions & 98 deletions JoystickVisualizer/Assets/Devices/Logitech 3D Pro/Logitech3DPro.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,104 +58,105 @@ void StickEvent(JoystickState state)
break;



case "Buttons10":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons11":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.z);
break;
case "Buttons12":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons13":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.z);
break;

case "Buttons14":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons15":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : -10.0f));
break;
case "Buttons16":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons17":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : 10.0f));
break;
case "Buttons18":
CMS.transform.localPosition = new Vector3(CMS.transform.localPosition.x, ((entry.Value == 0) ? 0.0f : -0.10f), CMS.transform.localPosition.z);
break;

case "Buttons6":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons7":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.z);
break;
case "Buttons8":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons9":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.z);
break;

case "Buttons1":
Pickle.transform.localPosition = new Vector3(Pickle.transform.localPosition.x, Pickle.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : 0.25f));
break;

case "Buttons4":
MasterMode.transform.localPosition = new Vector3(((entry.Value == 0) ? 0.0f : -0.20f), MasterMode.transform.localPosition.y, MasterMode.transform.localPosition.z);
break;

case "Buttons2":
PinkyButton.transform.localPosition = new Vector3(PinkyButton.transform.localPosition.x, PinkyButton.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : -0.20f));
break;

case "Buttons3":
PinkyLever.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), PinkyLever.transform.localEulerAngles.y, PinkyLever.transform.localEulerAngles.z);
break;

case "Buttons0":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;
case "Buttons5":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 10.0f : 20.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;

case "PointOfViewControllers0":
switch (entry.Value)
{
case -1: // zero
Trim.transform.localEulerAngles = Vector3.zero;
break;
case 0: // up
Trim.transform.localEulerAngles = Vector3.right * 10.0f;
break;
case 4500: // up/right
Trim.transform.localEulerAngles = Vector3.right * 10.0f + Vector3.down * 10.0f;
break;
case 9000: // right
Trim.transform.localEulerAngles = Vector3.down * 10.0f;
break;
case 13500: // down/right
Trim.transform.localEulerAngles = Vector3.down * 10.0f + Vector3.left * 10.0f;
break;
case 18000: // down
Trim.transform.localEulerAngles = Vector3.left * 10.0f;
break;
case 22500: // down/left
Trim.transform.localEulerAngles = Vector3.left * 10.0f + Vector3.up * 10.0f;
break;
case 27000: // left
Trim.transform.localEulerAngles = Vector3.up * 10.0f;
break;
case 31500: // up/left
Trim.transform.localEulerAngles = Vector3.up * 10.0f + Vector3.right * 10.0f;
break;
}
break;
/*
case "Buttons10":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons11":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.z);
break;
case "Buttons12":
DMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), DMS.transform.localEulerAngles.y, DMS.transform.localEulerAngles.z);
break;
case "Buttons13":
DMS.transform.localEulerAngles = new Vector3(DMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), DMS.transform.localEulerAngles.z);
break;
case "Buttons14":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons15":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : -10.0f));
break;
case "Buttons16":
CMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), CMS.transform.localEulerAngles.y, CMS.transform.localEulerAngles.z);
break;
case "Buttons17":
CMS.transform.localEulerAngles = new Vector3(CMS.transform.localEulerAngles.x, CMS.transform.localEulerAngles.y, ((entry.Value == 0) ? 0.0f : 10.0f));
break;
case "Buttons18":
CMS.transform.localPosition = new Vector3(CMS.transform.localPosition.x, ((entry.Value == 0) ? 0.0f : -0.10f), CMS.transform.localPosition.z);
break;
case "Buttons6":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons7":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.z);
break;
case "Buttons8":
TMS.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), TMS.transform.localEulerAngles.y, TMS.transform.localEulerAngles.z);
break;
case "Buttons9":
TMS.transform.localEulerAngles = new Vector3(TMS.transform.localEulerAngles.x, ((entry.Value == 0) ? 0.0f : 10.0f), TMS.transform.localEulerAngles.z);
break;
case "Buttons1":
Pickle.transform.localPosition = new Vector3(Pickle.transform.localPosition.x, Pickle.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : 0.25f));
break;
case "Buttons4":
MasterMode.transform.localPosition = new Vector3(((entry.Value == 0) ? 0.0f : -0.20f), MasterMode.transform.localPosition.y, MasterMode.transform.localPosition.z);
break;
case "Buttons2":
PinkyButton.transform.localPosition = new Vector3(PinkyButton.transform.localPosition.x, PinkyButton.transform.localPosition.y, ((entry.Value == 0) ? 0.0f : -0.20f));
break;
case "Buttons3":
PinkyLever.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : -10.0f), PinkyLever.transform.localEulerAngles.y, PinkyLever.transform.localEulerAngles.z);
break;
case "Buttons0":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 0.0f : 10.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;
case "Buttons5":
Trigger.transform.localEulerAngles = new Vector3(((entry.Value == 0) ? 10.0f : 20.0f), Trigger.transform.localEulerAngles.y, Trigger.transform.localEulerAngles.z);
break;
case "PointOfViewControllers0":
switch (entry.Value)
{
case -1: // zero
Trim.transform.localEulerAngles = Vector3.zero;
break;
case 0: // up
Trim.transform.localEulerAngles = Vector3.right * 10.0f;
break;
case 4500: // up/right
Trim.transform.localEulerAngles = Vector3.right * 10.0f + Vector3.down * 10.0f;
break;
case 9000: // right
Trim.transform.localEulerAngles = Vector3.down * 10.0f;
break;
case 13500: // down/right
Trim.transform.localEulerAngles = Vector3.down * 10.0f + Vector3.left * 10.0f;
break;
case 18000: // down
Trim.transform.localEulerAngles = Vector3.left * 10.0f;
break;
case 22500: // down/left
Trim.transform.localEulerAngles = Vector3.left * 10.0f + Vector3.up * 10.0f;
break;
case 27000: // left
Trim.transform.localEulerAngles = Vector3.up * 10.0f;
break;
case 31500: // up/left
Trim.transform.localEulerAngles = Vector3.up * 10.0f + Vector3.right * 10.0f;
break;
}
break;
*/
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,20 @@ void StickEvent(JoystickState state)
Model.SetActive(entry.Value == 1);
break;

case "RotationZ": // Left Throttle
// Rotate Z between -30 and 30
case "Z": // Right Throttle
// Rotate X between -30 and 30
GimbalLeft.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalLeft.transform.eulerAngles.y, GimbalLeft.transform.eulerAngles.z);
GimbalRight.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z);
break;

case "Z": // Right Throttle
// Rotate X between -30 and 30
// GimbalRight.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z);


/*
case "RotationZ": // Left Throttle
// Rotate Z between -30 and 30
GimbalLeft.transform.eulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 40, -25), GimbalLeft.transform.eulerAngles.y, GimbalLeft.transform.eulerAngles.z);
break;
case "Buttons28": // Right Throttle Idle/Off
if (entry.Value == 0)
GimbalRight.transform.eulerAngles = new Vector3(-25, GimbalRight.transform.eulerAngles.y, GimbalRight.transform.eulerAngles.z);
Expand Down Expand Up @@ -228,6 +231,7 @@ void StickEvent(JoystickState state)
case "Buttons13":
PinkySwitch.transform.localEulerAngles = Vector3.up * ((entry.Value == 0) ? 0.0f : -FLIP_SWITCH_ROTATION);
break;
*/
}
}
}
Expand Down

0 comments on commit 82ba1bb

Please sign in to comment.