Beispiel #1
0
        /// <summary>
        /// Returns true there are analog/digital mismatches
        /// </summary>
        /// <returns></returns>
        public bool TestForAnalogDigitalConflicts()
        {
            KeyboardMouseMap[] maps = new KeyboardMouseMap[] { _lsF, _rsF, _lsB, _rsB, _lsL, _rsL, _lsR, _rsR, _leftTrigger, _rightTrigger, _shoulderL, _shoulderR, _a, _b, _x, _y, _back, _start, _dpadF, _dpadB, _dpadL, _dpadR, _leftClick, _rightClick };

            for (int i = 1; i < maps.Length; i++)
            {
                if (maps[i].IsAnalog)
                {
                    continue;
                }
            }
            //make sure buttons are digital
            maps = new KeyboardMouseMap[] { _shoulderL, _shoulderR, _a, _b, _x, _y, _back, _start, _dpadF, _dpadB, _dpadL, _dpadR, _leftClick, _rightClick };
            foreach (KeyboardMouseMap map in maps)
            {
                if (map.IsAnalog)
                {
                    return(true);
                }
            }

            //directions must be analog or digital, not both
            if (_lsF.IsAnalog != _lsB.IsAnalog ||
                _lsL.IsAnalog != _lsR.IsAnalog ||
                _rsF.IsAnalog != _rsB.IsAnalog ||
                _rsL.IsAnalog != _rsR.IsAnalog)
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
 /// <summary></summary>
 public KeyboardMouseMapping()
 {
     _lsF          = Keys.W;
     _rsF          = MouseInput.YAxis;
     _lsB          = Keys.S;
     _rsB          = MouseInput.YAxis;
     _lsL          = Keys.A;
     _rsL          = MouseInput.XAxis;
     _lsR          = Keys.D;
     _rsR          = MouseInput.XAxis;
     _leftTrigger  = Keys.Q;
     _rightTrigger = Keys.R;
     _a            = Keys.Space;
     _b            = Keys.E;
     _x            = Keys.Z;
     _y            = Keys.C;
     _back         = Keys.Escape;
     _start        = Keys.Enter;
     _dpadF        = Keys.Up;
     _dpadB        = Keys.Down;
     _dpadL        = Keys.Left;
     _dpadR        = Keys.Right;
     _leftClick    = MouseInput.LeftButton;
     _rightClick   = MouseInput.RightButton;
     _shoulderL    = Keys.F;
     _shoulderR    = Keys.V;
 }
Beispiel #3
0
 /// <summary>
 /// Returns true if two or more mappings share the same value
 /// </summary>
 /// <returns></returns>
 public bool TestForConflicts()
 {
     KeyboardMouseMap[] maps = new KeyboardMouseMap[] { _lsF, _rsF, _lsB, _rsB, _lsL, _rsL, _lsR, _rsR, _leftTrigger, _rightTrigger, _shoulderL, _shoulderR, _a, _b, _x, _y, _back, _start, _dpadF, _dpadB, _dpadL, _dpadR, _leftClick, _rightClick };
     Array.Sort <KeyboardMouseMap>(maps);
     for (int i = 1; i < maps.Length; i++)
     {
         if (maps[i - 1].CompareTo(maps[i]) == 0)
         {
             return(true);
         }
     }
     return(false);
 }