Exemple #1
0
        // ------------------
        public GamepadProfile()
        {
            this.name = "New Profile";
            this.joystickIdentifier = "Device Identifier";
            this.profileMode        = ProfileMode.Normal;

            this.unityVerFrom = "4.7";
            this.unityVerTo   = "9.9";



            this.dpad       = new JoystickSource();
            this.leftStick  = new JoystickSource();
            this.rightStick = new JoystickSource();

            this.keyFaceU  = KeySource.Empty();
            this.keyFaceR  = KeySource.Empty();
            this.keyFaceD  = KeySource.Empty();
            this.keyFaceL  = KeySource.Empty();
            this.keyStart  = KeySource.Empty();
            this.keySelect = KeySource.Empty();
            this.keyL1     = KeySource.Empty();
            this.keyR1     = KeySource.Empty();
            this.keyL2     = KeySource.Empty();
            this.keyR2     = KeySource.Empty();
            this.keyL3     = KeySource.Empty();
            this.keyR3     = KeySource.Empty();
        }
Exemple #2
0
 // ----------------
 public bool IsDuplicateOf(JoystickSource a)
 {
     return(
         this.keyD.IsDuplicateOf(a.keyD) &&
         this.keyU.IsDuplicateOf(a.keyU) &&
         this.keyL.IsDuplicateOf(a.keyL) &&
         this.keyR.IsDuplicateOf(a.keyR));
 }
Exemple #3
0
            // ----------------------
            public static JoystickSource Axes(int horzAxisId, bool horzPositiveRight, int vertAxisId, bool vertPositiveUp)
            {
                JoystickSource s = new JoystickSource();

                s.keyR.SetAxis(horzAxisId, horzPositiveRight);
                s.keyL.SetAxis(horzAxisId, horzPositiveRight);

                s.keyU.SetAxis(vertAxisId, vertPositiveUp);
                s.keyD.SetAxis(vertAxisId, vertPositiveUp);

                return(s);
            }
Exemple #4
0
            // --------------------
            public static JoystickSource Dpad(int keyU, int keyR, int keyD, int keyL)
            {
                JoystickSource s = new JoystickSource();

                s.keyD.SetKey(keyD);
                s.keyU.SetKey(keyU);
                s.keyL.SetKey(keyL);
                s.keyR.SetKey(keyR);


                return(s);
            }
Exemple #5
0
        // --------------------
        public GamepadProfile(
            string name,
            string deviceIdentifier,
            ProfileMode profileMode,
            string unityVerFrom,
            string unityVerTo,
            JoystickSource leftStick,
            JoystickSource rightStick,
            JoystickSource dpad,
            KeySource keyFaceD,
            KeySource keyFaceR,
            KeySource keyFaceL,
            KeySource keyFaceU,
            KeySource keySelect,
            KeySource keyStart,
            KeySource keyL1,
            KeySource keyR1,
            KeySource keyL2,
            KeySource keyR2,
            KeySource keyL3,
            KeySource keyR3)
        {
            this.name = name;
            this.joystickIdentifier = deviceIdentifier;
            this.profileMode        = profileMode;
            //this.platformFlags        = platformFlags;
            this.unityVerFrom = (string.IsNullOrEmpty(unityVerFrom)   ? "4.3" : unityVerFrom);
            this.unityVerTo   = (string.IsNullOrEmpty(unityVerTo)     ? "9.9" : unityVerTo);



            //this.sticks	= new JoystickSource[GamepadManager.GamepadStickCount];
            //this.keys	= new KeySource[GamepadManager.GamepadKeyCount];

            this.leftStick  = (leftStick != null)   ? leftStick     : JoystickSource.Empty();
            this.rightStick = (rightStick != null)  ? rightStick    : JoystickSource.Empty();
            this.dpad       = (dpad != null)                ? dpad                  : JoystickSource.Empty();

            this.keyFaceU = (keyFaceU != null)    ? keyFaceU              : KeySource.Empty();
            this.keyFaceR = (keyFaceR != null)    ? keyFaceR              : KeySource.Empty();
            this.keyFaceD = (keyFaceD != null)    ? keyFaceD              : KeySource.Empty();
            this.keyFaceL = (keyFaceL != null)    ? keyFaceL              : KeySource.Empty();

            this.keyStart  = (keyStart != null)    ? keyStart              : KeySource.Empty();
            this.keySelect = (keySelect != null)   ? keySelect             : KeySource.Empty();

            this.keyL1 = (keyL1 != null)               ? keyL1         : KeySource.Empty();
            this.keyR1 = (keyR1 != null)               ? keyR1         : KeySource.Empty();
            this.keyL2 = (keyL2 != null)               ? keyL2         : KeySource.Empty();
            this.keyR2 = (keyR2 != null)               ? keyR2         : KeySource.Empty();
            this.keyL3 = (keyL3 != null)               ? keyL3         : KeySource.Empty();
            this.keyR3 = (keyR3 != null)               ? keyR3         : KeySource.Empty();
        }
Exemple #6
0
        // -------------------
        public JoystickSource GetJoystickSource(int id)
        {
            JoystickSource joy = null;

            switch (id)
            {
            case (int)GamepadManager.GamepadStick.LeftAnalog: joy = this.leftStick; break;

            case (int)GamepadManager.GamepadStick.RightAnalog: joy = this.rightStick; break;

            case (int)GamepadManager.GamepadStick.Dpad: joy = this.dpad; break;
            }

            return(joy);
        }