Beispiel #1
0
        public IController NewDevice(IDevice device)
        {
            SixtyBeatAudioDevice _device = device as SixtyBeatAudioDevice;

            if (_device == null)
            {
                return(null);
            }

            {
                SixtyBeatGamepadController ctrl = new SixtyBeatGamepadController(_device);
                return(ctrl);
            }
        }
        public SixtyBeatGamepadController(SixtyBeatAudioDevice device)
        {
            ConnectionTypeCode = new string[] { "CONNECTION_WIRE_35MM_PHONE_TRRS", "CONNECTION_WIRE" };
            ControllerTypeCode = new string[] { "DEVICE_SIXTYBEAT_GAMEPAD", "DEVICE_GAMEPAD" };

            State.Controls["cluster_left"]  = new ControlButtonQuad();
            State.Controls["cluster_right"] = new ControlButtonQuad();
            State.Controls["bumper_right"]  = new ControlButton();
            State.Controls["bumper_left"]   = new ControlButton();
            State.Controls["trigger_right"] = new ControlButton();
            State.Controls["trigger_left"]  = new ControlButton();
            State.Controls["menu_right"]    = new ControlButton();
            State.Controls["menu_left"]     = new ControlButton();
            State.Controls["home"]          = new ControlButton();
            State.Controls["stick_left"]    = new ControlStickWithClick();
            State.Controls["stick_right"]   = new ControlStickWithClick();

            _device    = device;
            Initalized = false;

            _device.DeviceReport += OnReport;
        }