Beispiel #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;
 }
Beispiel #2
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;

          

        }