Show / Hide Table of Contents

Interface IGamepad

The interface for a gamepad object.

Namespace: Phoenix.Input
Assembly: Phoenix.Abstractions.Input.dll
Syntax
public interface IGamepad

Properties

View Source

Device

Gets the device that the gamepad is bound to.

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

Id

Gets the id for the gamepad.

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

Methods

View Source

Disconnect()

Disconnects the controller from the device.

Declaration
void Disconnect()
View Source

GetButtonsState()

Gets the gamepad's button state.

Declaration
GamepadButtons GetButtonsState()
Returns
Type Description
GamepadButtons

The gamepad button state object.

View Source

GetJoystickPosition(JoystickType)

Gets the joystick position for the gamepad.

Declaration
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
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
void HoldButtons(GamepadButtons buttons)
Parameters
Type Name Description
GamepadButtons buttons

The buttons states to hold.

View Source

ReleaseButtons(GamepadButtons)

Releases the specified buttons.

Declaration
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
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
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
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.

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