コード例 #1
0
 public DS4Device(HidDevice device, int controllerID)
 {
     hid_device = device;
     deviceNum  = controllerID;
     isUSB      = Device.Capabilities.InputReportByteLength == 64;
     MACAddr    = Device.readSerial();
     if (isUSB)
     {
         outputData = new byte[Device.Capabilities.OutputReportByteLength];
     }
     else
     {
         btInputData = new byte[Device.Capabilities.InputReportByteLength];
         outputData  = new byte[78];
     }
     isTouchEnabled             = Global.getTouchEnabled(deviceNum);
     touchpad                   = new Touchpad(deviceNum);
     mouse                      = new Mouse(deviceNum);
     touchpad.TouchButtonDown  += mouse.touchButtonDown;
     touchpad.TouchButtonUp    += mouse.touchButtonUp;
     touchpad.TouchesBegan     += mouse.touchesBegan;
     touchpad.TouchesMoved     += mouse.touchesMoved;
     touchpad.TouchesEnded     += mouse.touchesEnded;
     Device.MonitorDeviceEvents = true;
 }
コード例 #2
0
ファイル: DS4Device.cs プロジェクト: Conist/ds4-tool
        public DS4Device(HidDevice device, int controllerID)
        {
            hid_device = device;
            deviceNum = controllerID;
            isUSB = Device.Capabilities.InputReportByteLength == 64;
            MACAddr = Device.readSerial();
            if (isUSB)
            {
                outputData = new byte[Device.Capabilities.OutputReportByteLength];
            }
            else
            {
                btInputData = new byte[Device.Capabilities.InputReportByteLength];
                outputData = new byte[78];
            }
            isTouchEnabled = Global.getTouchEnabled(deviceNum);
            touchpad = new Touchpad(deviceNum);
            mouse = new Mouse(deviceNum);
            touchpad.TouchButtonDown += mouse.touchButtonDown;
            touchpad.TouchButtonUp += mouse.touchButtonUp;
            touchpad.TouchesBegan += mouse.touchesBegan;
            touchpad.TouchesMoved += mouse.touchesMoved;
            touchpad.TouchesEnded += mouse.touchesEnded;
            Device.MonitorDeviceEvents = true;

          

        }