/// <summary> /// Retrieves the current state of a controller by polling it using the XInput.GetState /// function. The result from this poll is stored in the internal State struct, which can /// be retrieved through this controller's State property. /// </summary> /// <returns>A boolean whether or not the poll was successful</returns> public bool PollState() { // this may be limited to once per frame or to a specific time period, using // AutomaticallyPollState to disable automatic polling through other accessors return(XInput.GetState(this.playerIndex, ref this.state) == XInput.ERROR_SUCCESS); }
public void SetMotorSpeeds(ushort leftMotor, ushort rightMotor) { vibration.LeftMotorSpeed = leftMotor; vibration.RightMotorSpeed = rightMotor; XInput.SetState(this.playerIndex, ref this.vibration); }