private bool CheckDpadDs4(ScpHidReport Data, DSButton parButton) { if (parButton.DS4 != null) { return(Data[parButton.DS4].IsPressed); } else { return(false); } }
private void AssignButton(ref uint parSourceButton, DSButton parSourceID, string parTargetButton) { if (parTargetButton.StartsWith("B")) { //used for button uint buttonid = uint.Parse(parTargetButton.Remove(0, 1)); if (buttonid > m_nButtons) { m_nButtons = (byte)buttonid; } parSourceButton = buttonid; } else if (parTargetButton.StartsWith("P")) { //used for POV m_dpad = true; switch (parTargetButton) { case "PU": { m_PUp = parSourceID; } break; case "PD": { m_PDown = parSourceID; } break; case "PL": { m_PLeft = parSourceID; } break; case "PR": { m_PRight = parSourceID; } break; } } else if (parTargetButton.StartsWith("A")) { //Button As Axis uint axisCode = 0; string[] Setting = parTargetButton.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries); if (Setting[1] == "UL") { axisCode = 1000; } else if (Setting[1] == "DR") { axisCode = 2000; } else { return; } HID_USAGES TargetAxis = 0; AssignAxis(ref TargetAxis, Setting[0]); axisCode += (uint)TargetAxis; parSourceButton = axisCode; } }
private bool CheckDpadDs4(ScpHidReport Data, DSButton parButton) { if (parButton.DS4 != null) { return Data[parButton.DS4].IsPressed; } else { return false; } }
private bool CheckDpadDs4(DsPacket Data, DSButton parButton) { if (parButton.DS4 != Ds4Button.None) { return Data.Button(parButton.DS4); } else { return false; } }