public ControllerXbox360(params int[] joystickId)
        {
            AddButton(Controls.A);
            AddButton(Controls.B);
            AddButton(Controls.X);
            AddButton(Controls.Y);
            AddButton(Controls.RB);
            AddButton(Controls.LB);
            AddButton(Controls.LStickClick);
            AddButton(Controls.RStickClick);
            AddButton(Controls.Start);
            AddButton(Controls.Back);
            AddButton(Controls.RT);
            AddButton(Controls.LT);
            AddButton(Controls.Up);
            AddButton(Controls.Down);
            AddButton(Controls.Left);
            AddButton(Controls.Right);

            AddAxis(Controls.LStick);
            AddAxis(Controls.RStick);
            AddAxis(Controls.DPad);
            AddAxis(Controls.Triggers);

            foreach (var joy in joystickId)
            {
                A.AddJoyButton(0, joy);
                B.AddJoyButton(1, joy);
                X.AddJoyButton(2, joy);
                Y.AddJoyButton(3, joy);
                LB.AddJoyButton(4, joy);
                RB.AddJoyButton(5, joy);
                Back.AddJoyButton(6, joy);
                Start.AddJoyButton(7, joy);
                LeftStickClick.AddJoyButton(8, joy);
                RightStickClick.AddJoyButton(9, joy);

                RT.AddAxisButton(AxisButton.ZMinus, joy);
                LT.AddAxisButton(AxisButton.ZPlus, joy);

                LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy);
                RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy);
                DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy);
                Triggers.AddJoyAxis(JoyAxis.Z, JoyAxis.Z, joy);

                Up
                .AddAxisButton(AxisButton.YMinus, joy)
                .AddAxisButton(AxisButton.PovYMinus, joy);
                Down
                .AddAxisButton(AxisButton.YPlus, joy)
                .AddAxisButton(AxisButton.PovYPlus, joy);
                Right
                .AddAxisButton(AxisButton.XPlus, joy)
                .AddAxisButton(AxisButton.PovXPlus, joy);
                Left
                .AddAxisButton(AxisButton.XMinus, joy)
                .AddAxisButton(AxisButton.PovXMinus, joy);
            }
        }
示例#2
0
        public ControllerPS3(params int[] joystickId)
        {
            AddButton(Controls.Triangle);
            AddButton(Controls.Circle);
            AddButton(Controls.Cross);
            AddButton(Controls.Square);
            AddButton(Controls.R1);
            AddButton(Controls.L1);
            AddButton(Controls.L3);
            AddButton(Controls.R3);
            AddButton(Controls.Start);
            AddButton(Controls.Select);
            AddButton(Controls.R2);
            AddButton(Controls.L2);

            AddAxis(Controls.LStick);
            AddAxis(Controls.RStick);
            AddAxis(Controls.DPad);

            foreach (var joy in joystickId)
            {
                Triangle.AddJoyButton(0, joy);
                Circle.AddJoyButton(1, joy);
                Cross.AddJoyButton(2, joy);
                Square.AddJoyButton(3, joy);
                L2.AddJoyButton(4, joy);
                R2.AddJoyButton(5, joy);
                L1.AddJoyButton(6, joy);
                R1.AddJoyButton(7, joy);
                Select.AddJoyButton(8, joy);
                Start.AddJoyButton(9, joy);
                L3.AddJoyButton(10, joy);
                R3.AddJoyButton(11, joy);

                R2.AddAxisButton(AxisButton.ZMinus, joy);
                L2.AddAxisButton(AxisButton.ZPlus, joy);

                LeftStick.AddJoyAxis(JoyAxis.X, JoyAxis.Y, joy);
                RightStick.AddJoyAxis(JoyAxis.U, JoyAxis.R, joy);
                DPad.AddJoyAxis(JoyAxis.PovX, JoyAxis.PovY, joy);
            }
        }