Show / Hide Table of Contents

Class Gamepad

Implementation for the gamepad class.

Inheritance
System.Object
Gamepad
Implements
IGamepad
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.Input
Assembly: Phoenix.Plugin.Input.dll
Syntax
public class Gamepad : IGamepad

Constructors

View Source

Gamepad(IDevice, Guid)

Initializes a new instance of the Gamepad class

Declaration
public Gamepad(IDevice device, Guid gamepadId)
Parameters
Type Name Description
IDevice device

Device to connect to

System.Guid gamepadId

The id for the gamepad on the device to use

Properties

View Source

Device

Gets the device that the gamepad is bound to.

Declaration
public IDevice Device { get; }
Property Value
Type Description
IDevice
View Source

Id

Gets the id for the gamepad.

Declaration
public Guid Id { get; }
Property Value
Type Description
System.Guid

Methods

View Source

Disconnect()

Disconnects the controller from the device.

Declaration
public void Disconnect()
View Source

GetButtonsState()

Gets the gamepad's button state.

Declaration
public GamepadButtons GetButtonsState()
Returns
Type Description
GamepadButtons

The gamepad button state object.

View Source

GetJoystickPosition(JoystickType)

Gets the joystick position for the gamepad.

Declaration
public JoystickPosition GetJoystickPosition(JoystickType joystick)
Parameters
Type Name Description
JoystickType joystick

Which joystick to query.

Returns
Type Description
JoystickPosition

The queried joystick's position.

View Source

GetTriggerPosition(TriggerType)

Gets the trigger position for the gamepad.

Declaration
public float GetTriggerPosition(TriggerType trigger)
Parameters
Type Name Description
TriggerType trigger

Which trigger to query.

Returns
Type Description
System.Single

The queried trigger's position (0 to 1)

View Source

HoldButtons(GamepadButtons)

Holds down the specified buttons.

Declaration
public void HoldButtons(GamepadButtons buttons)
Parameters
Type Name Description
GamepadButtons buttons

The buttons states to hold.

View Source

ReleaseButtons(GamepadButtons)

Releases the specified buttons.

Declaration
public void ReleaseButtons(GamepadButtons buttons)
Parameters
Type Name Description
GamepadButtons buttons

The buttons to release.

View Source

SetJoystickPosition(JoystickType, JoystickPosition)

Sets the joystick position for the gamepad.

Declaration
public void SetJoystickPosition(JoystickType joystick, JoystickPosition position)
Parameters
Type Name Description
JoystickType joystick

Which joystick to use.

JoystickPosition position

The position object representing the new joystick positions

View Source

SetTriggerPosition(TriggerType, Single)

Sets the trigger position for the gamepad.

Declaration
public void SetTriggerPosition(TriggerType trigger, float position)
Parameters
Type Name Description
TriggerType trigger

Which trigger to use.

System.Single position

The position of the trigger (0 to 1)

View Source

TryPairWithUser(PhoenixUser, Boolean)

Tries to pair with a user.

Declaration
public Task<bool> TryPairWithUser(PhoenixUser user, bool exclusive)
Parameters
Type Name Description
PhoenixUser user

The user to pair with.

System.Boolean exclusive

Whether or not the gamepad is to be exclusively paired with the user or not.

Returns
Type Description
System.Threading.Tasks.Task<System.Boolean>

True if the pairing was successful, otherwise False.

Implements

IGamepad
  • View Source
In This Article
Back to top Generated by DocFX