protected virtual void SampleDs4(DsPacket Packet) { m_dx = Mouse(Packet.Axis(Ds4Axis.RX), m_vx); m_dy = Mouse(Packet.Axis(Ds4Axis.RY), m_vy); }
private void Parse(object sender, DsPacket e) { lock (this) { if (e.Detail.Pad == (DsPadId)m_SelectedPad) { if (e.Detail.State != DsState.Connected) { ResetControls(); return; } scpProxy.Remap(m_SelectedProfile, e); switch (e.Detail.Model) { case DsModel.DS3: { axLX.Value = e.Axis(Ds3Axis.LX); axLY.Value = e.Axis(Ds3Axis.LY); axRX.Value = e.Axis(Ds3Axis.RX); axRY.Value = e.Axis(Ds3Axis.RY); axL1.Value = e.Axis(Ds3Axis.L1); axR1.Value = e.Axis(Ds3Axis.R1); axL2.Value = e.Axis(Ds3Axis.L2); axR2.Value = e.Axis(Ds3Axis.R2); axL3.Value = (Byte)(e.Button(Ds3Button.L3) ? 255 : 0); axR3.Value = (Byte)(e.Button(Ds3Button.R3) ? 255 : 0); axSH.Value = (Byte)(e.Button(Ds3Button.Select) ? 255 : 0); axOP.Value = (Byte)(e.Button(Ds3Button.Start) ? 255 : 0); axT.Value = e.Axis(Ds3Axis.Triangle); axC.Value = e.Axis(Ds3Axis.Circle); axX.Value = e.Axis(Ds3Axis.Cross); axS.Value = e.Axis(Ds3Axis.Square); axU.Value = e.Axis(Ds3Axis.Up); axR.Value = e.Axis(Ds3Axis.Right); axD.Value = e.Axis(Ds3Axis.Down); axL.Value = e.Axis(Ds3Axis.Left); axPS.Value = (Byte)(e.Button(Ds3Button.PS) ? 255 : 0); } break; case DsModel.DS4: { axLX.Value = e.Axis(Ds4Axis.LX); axLY.Value = e.Axis(Ds4Axis.LY); axRX.Value = e.Axis(Ds4Axis.RX); axRY.Value = e.Axis(Ds4Axis.RY); axL2.Value = e.Axis(Ds4Axis.L2); axR2.Value = e.Axis(Ds4Axis.R2); axL1.Value = (Byte)(e.Button(Ds4Button.L1) ? 255 : 0); axR1.Value = (Byte)(e.Button(Ds4Button.R1) ? 255 : 0); axL3.Value = (Byte)(e.Button(Ds4Button.L3) ? 255 : 0); axR3.Value = (Byte)(e.Button(Ds4Button.R3) ? 255 : 0); axSH.Value = (Byte)(e.Button(Ds4Button.Share) ? 255 : 0); axOP.Value = (Byte)(e.Button(Ds4Button.Options) ? 255 : 0); axT.Value = (Byte)(e.Button(Ds4Button.Triangle) ? 255 : 0); axC.Value = (Byte)(e.Button(Ds4Button.Circle) ? 255 : 0); axX.Value = (Byte)(e.Button(Ds4Button.Cross) ? 255 : 0); axS.Value = (Byte)(e.Button(Ds4Button.Square) ? 255 : 0); axU.Value = (Byte)(e.Button(Ds4Button.Up) ? 255 : 0); axR.Value = (Byte)(e.Button(Ds4Button.Right) ? 255 : 0); axD.Value = (Byte)(e.Button(Ds4Button.Down) ? 255 : 0); axL.Value = (Byte)(e.Button(Ds4Button.Left) ? 255 : 0); axPS.Value = (Byte)(e.Button(Ds4Button.PS) ? 255 : 0); axTP.Value = (Byte)(e.Button(Ds4Button.TouchPad) ? 255 : 0); } break; } } } }