public byte GetAnalogHat(AnalogHat a) { if (readBuffer == null) { return(0); } return((byte)(readBuffer[(uint)a])); }
/// <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]); }