Interface IGamepad
The interface for a gamepad object.
Namespace: Phoenix.Input
Assembly: Phoenix.Abstractions.Input.dll
Syntax
public interface IGamepad
Properties
View SourceDevice
Gets the device that the gamepad is bound to.
Declaration
IDevice Device { get; }
Property Value
Type | Description |
---|---|
IDevice |
Id
Gets the id for the gamepad.
Declaration
Guid Id { get; }
Property Value
Type | Description |
---|---|
System.Guid |
Methods
View SourceDisconnect()
Disconnects the controller from the device.
Declaration
void Disconnect()
GetButtonsState()
Gets the gamepad's button state.
Declaration
GamepadButtons GetButtonsState()
Returns
Type | Description |
---|---|
GamepadButtons | The gamepad button state object. |
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. |
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) |
HoldButtons(GamepadButtons)
Holds down the specified buttons.
Declaration
void HoldButtons(GamepadButtons buttons)
Parameters
Type | Name | Description |
---|---|---|
GamepadButtons | buttons | The buttons states to hold. |
ReleaseButtons(GamepadButtons)
Releases the specified buttons.
Declaration
void ReleaseButtons(GamepadButtons buttons)
Parameters
Type | Name | Description |
---|---|---|
GamepadButtons | buttons | The buttons to release. |
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 |
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) |
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. |