// Set the vibration speed of a controller public static void SetVibration(int controllerNumber, ushort leftSpeed, ushort rightSpeed) { XInputVibration vibe = new XInputVibration(leftSpeed, rightSpeed); XInputMethods.ProcessResult( XInputMethods.XInputSetState(controllerNumber, ref vibe) ); }
// Get the DirectSound guids for sending/receiving audio to the controller's headset public static void GetAudioGuids(int controllerNumber, out Guid renderGuid, out Guid captureGuid) { XInputMethods.ProcessResult(XInputMethods.XInputGetDSoundAudioDeviceGuids(controllerNumber, out renderGuid, out captureGuid)); }
// Poll the state of the controller's buttons, thumbsticks, and triggers public static void GetState(int controllerNumber, out XInputState state) { XInputMethods.ProcessResult( XInputMethods.XInputGetState(controllerNumber, out state) ); }
// Get the capabilities of controller 0, 1, 2, or 3 public static void GetCapabilities(int controllerNumber, out XInputCapabilities caps) { XInputMethods.ProcessResult( XInputMethods.XInputGetCapabilities(controllerNumber, 0, out caps) ); }