public static void CopyBytes(ref DS4_REPORT_EX outReport, byte[] outBuffer)
        {
            GCHandle h = GCHandle.Alloc(outReport, GCHandleType.Pinned);

            Marshal.Copy(h.AddrOfPinnedObject(), outBuffer, 0, 63);
            h.Free();
        }
示例#2
0
        public override void ResetState(bool submit = true)
        {
            outDS4Report           = default(DS4_REPORT_EX);
            outDS4Report.wButtons &= unchecked ((ushort)~0X0F);
            outDS4Report.wButtons |= 0x08;
            outDS4Report.bThumbLX  = 0x80;
            outDS4Report.bThumbLY  = 0x80;
            outDS4Report.bThumbRX  = 0x80;
            outDS4Report.bThumbRY  = 0x80;
            DS4OutDeviceExtras.CopyBytes(ref outDS4Report, rawOutReportEx);

            if (submit)
            {
                cont.SubmitRawReport(rawOutReportEx);
            }
        }