Example #1
0
 public byte GetAnalogHat(AnalogHat a)
 {
     if (readBuffer == null)
     {
         return(0);
     }
     return((byte)(readBuffer[(uint)a]));
 }
Example #2
0
        /// <summary>
        /// Get the position of the analog hat inputs
        /// </summary>
        /// <param name="hat">Hat input to get the state of</param>
        /// <returns>Position of the hat switch.</returns>
        public short GetAnalogHat(AnalogHat hat)
        {
            if (!IsConnected || XBoxJoystickData == null)
            {
                return(0);
            }

            lock (XBoxJoystickData)
            {
                return((short)((XBoxJoystickData[(uint)hat + 1] << 8) | XBoxJoystickData[(uint)hat]));
            }
        }
 public byte GetAnalogHat(AnalogHat a)
 {
     if (readBuffer == null)
         return 0;
     return (byte)(readBuffer[(uint)a]);
 }