Пример #1
0
        public PS3uDrawTabletDevice()
        {
            ButtonState       = new TabletButtonState();
            DPadState         = new TabletDPadState();
            UnknownData1      = new byte[_UNKNOWN_DATA1_SIZE];
            AccelerometerData = new TabletAccelerometerData();

            _device = new HIDDevice(_VENDOR_ID, _PRODUCT_ID);
            _device.DataReceived += _device_DataReceived;
        }
Пример #2
0
        public PS3uDrawTabletDevice()
        {
            ButtonState = new TabletButtonState();
              DPadState = new TabletDPadState();
              UnknownData1 = new byte[_UNKNOWN_DATA1_SIZE];
              AccelerometerData = new TabletAccelerometerData();

              _device = new HIDDevice(_VENDOR_ID, _PRODUCT_ID);
              _device.DataReceived += _device_DataReceived;
        }
Пример #3
0
        public Xbox360uDrawTabletDevice(WirelessReceiver receiver, int index)
        {
            ButtonState       = new TabletButtonState();
            DPadState         = new TabletDPadState();
            AccelerometerData = new TabletAccelerometerData();

            _index    = index;
            _receiver = receiver;
            _receiver.EventDataReceived += _receiver_EventDataReceived;
        }
Пример #4
0
        public Xbox360InputDevice(WirelessReceiver receiver, int index, WirelessReceiver.DeviceInformation info)
        {
            ButtonState       = new TabletButtonState();
            DPadState         = new TabletDPadState();
            AccelerometerData = new TabletAccelerometerData();

            _index    = index;
            _receiver = receiver;
            Info      = info;
            _receiver.EventDataReceived += _receiver_EventDataReceived;
        }
Пример #5
0
        public Xbox360InputDevice(WirelessReceiver receiver, int index, WirelessReceiver.DeviceInformation info)
        {
            ButtonState = new TabletButtonState();
              DPadState = new TabletDPadState();
              AccelerometerData = new TabletAccelerometerData();

              _index = index;
              _receiver = receiver;
              Info = info;
              _receiver.EventDataReceived += _receiver_EventDataReceived;
        }
Пример #6
0
        public Object Clone()
        {
            var ret = new TabletButtonState();

              ret.CircleHeld = this.CircleHeld;
              ret.CrossHeld = this.CrossHeld;
              ret.PSHeld = this.PSHeld;
              ret.SelectHeld = this.SelectHeld;
              ret.SquareHeld = this.SquareHeld;
              ret.StartHeld = this.StartHeld;
              ret.TriangleHeld = this.TriangleHeld;
              ret.LeftStickHeld = this.LeftStickHeld;
              ret.RightStickHeld = this.RightStickHeld;
              ret.LeftButtonHeld = this.LeftButtonHeld;
              ret.RightButtonHeld = this.RightButtonHeld;

              return ret;
        }
Пример #7
0
        public Object Clone()
        {
            var ret = new TabletButtonState();

            ret.CircleHeld      = this.CircleHeld;
            ret.CrossHeld       = this.CrossHeld;
            ret.PSHeld          = this.PSHeld;
            ret.SelectHeld      = this.SelectHeld;
            ret.SquareHeld      = this.SquareHeld;
            ret.StartHeld       = this.StartHeld;
            ret.TriangleHeld    = this.TriangleHeld;
            ret.LeftStickHeld   = this.LeftStickHeld;
            ret.RightStickHeld  = this.RightStickHeld;
            ret.LeftButtonHeld  = this.LeftButtonHeld;
            ret.RightButtonHeld = this.RightButtonHeld;

            return(ret);
        }
Пример #8
0
        public WiiInputDevice(string devicePath, int? index)
        {
            ButtonState = new TabletButtonState();
              DPadState = new TabletDPadState();
              AccelerometerData = new TabletAccelerometerData();
              _acknowledgements = new Dictionary<byte, int>();

              _device = new HIDDevice(devicePath);

              //Initialize the device
              Index = index;
              _device.DataReceived += _device_DataReceived;
              if (index.HasValue)
              {
            EnableLEDs(index.Value == 0, index.Value == 1, index.Value == 2, index.Value == 3);
              }

              //Get the initial status
              _lastReportingMode = 0x37;
              RefreshStatus();
        }
Пример #9
0
        public WiiInputDevice(string devicePath, int?index)
        {
            ButtonState       = new TabletButtonState();
            DPadState         = new TabletDPadState();
            AccelerometerData = new TabletAccelerometerData();
            _acknowledgements = new Dictionary <byte, int>();

            _device = new HIDDevice(devicePath);

            //Initialize the device
            Index = index;
            _device.DataReceived += _device_DataReceived;
            if (index.HasValue)
            {
                EnableLEDs(index.Value == 0, index.Value == 1, index.Value == 2, index.Value == 3);
            }

            //Get the initial status
            _lastReportingMode = 0x37;
            RefreshStatus();
        }
Пример #10
0
        private static void device_ButtonStateChanged(object sender, EventArgs e)
        {
            //Click Cross
              if (_tablet.ButtonState.CrossHeld != _lastButtonState.CrossHeld)
              uDrawButtonClick(CrossButton);
              //Click SQUARE
              if (_tablet.ButtonState.SquareHeld != _lastButtonState.SquareHeld)
              uDrawButtonClick(SquareButton);
              //Click TRIANGLE
              if (_tablet.ButtonState.TriangleHeld != _lastButtonState.TriangleHeld && _tablet.ButtonState.TriangleHeld)
              uDrawButtonClick(CircleButton);
              //Click Circle
              if (_tablet.ButtonState.CircleHeld != _lastButtonState.CircleHeld && _tablet.ButtonState.CircleHeld)
              {
              uDrawButtonClick(CircleButton);
              }
              //Click Select
              if (_tablet.ButtonState.SelectHeld != _lastButtonState.SelectHeld && _tablet.ButtonState.SelectHeld)
              {
              uDrawButtonClick(SelectButton);
              }
              //Click Start
              if (_tablet.ButtonState.StartHeld != _lastButtonState.StartHeld && _tablet.ButtonState.StartHeld)
              {
              uDrawButtonClick(StartButton);
              }
              //Click PS
              if (_tablet.ButtonState.PSHeld != _lastButtonState.PSHeld && _tablet.ButtonState.PSHeld)
              _preferences.ShowPreferences();

              _lastButtonState = _tablet.ButtonState;
        }
Пример #11
0
        public static void Start(Preferences preferences)
        {
            _preferences = preferences;
              preferences.LoadPreferences();

              _tablet = new uDrawTabletDevice();

              _lastButtonState = _tablet.ButtonState;
              _tablet.ButtonStateChanged += device_ButtonStateChanged;

              if (_handleTabletEventsThread == null)
              {
            _handleTabletEventsThread = new Thread(new ThreadStart(_HandleTabletEvents));
            _handleTabletEventsThread.Start();
              }
        }