Class Controller
Controller represent one physical GamePad attached to the system
public sealed class Controller
- Inheritance
-
Controller
- Inherited Members
Properties
AnyButtonPressed
Return true if any controller button was just pressed
public bool AnyButtonPressed { get; }
Property Value
AnyButtonReleased
Return true if any controller button was just released
public bool AnyButtonReleased { get; }
Property Value
CurrentButtonsState
Get combined button states
public ControllerButtons CurrentButtonsState { get; }
Property Value
DisplayName
Controller display name
public string DisplayName { get; }
Property Value
HasAButton
Return true if has A button
public bool HasAButton { get; }
Property Value
HasBButton
Return true if has B button
public bool HasBButton { get; }
Property Value
HasLeftShoulderButton
Check if the Game Controller has left shoulder button
public bool HasLeftShoulderButton { get; }
Property Value
HasLeftThumbstick
Check if the Game Controller has left thumbstick
public bool HasLeftThumbstick { get; }
Property Value
HasLeftThumbstickButton
Check if the Game Controller has left thumbstick Button
public bool HasLeftThumbstickButton { get; }
Property Value
HasLeftTriggerButton
Check if the Game Controller has left trigger Button
public bool HasLeftTriggerButton { get; }
Property Value
HasMenuButton
Check if the Game Controller has Menu/Start button
public bool HasMenuButton { get; }
Property Value
HasOptionsButton
Check if the Game Controller has Options/Back button
public bool HasOptionsButton { get; }
Property Value
HasRightShoulderButton
Check if the Game controller has right shoulder button
public bool HasRightShoulderButton { get; }
Property Value
HasRightThumbstick
Check if the Game Controller has right thumbstick
public bool HasRightThumbstick { get; }
Property Value
HasRightThumbstickButton
Check if the Game Controller has Right Thumbstick button
public bool HasRightThumbstickButton { get; }
Property Value
HasRightTriggerButton
Check if the Game Controller has right trigger Button
public bool HasRightTriggerButton { get; }
Property Value
HasXButton
Return true if has X button
public bool HasXButton { get; }
Property Value
HasYButton
Return true if has Y button
public bool HasYButton { get; }
Property Value
Index
Get controller index
public int Index { get; }
Property Value
IsConnected
Check if the controller is connected
public bool IsConnected { get; }
Property Value
LeftThumbstickValue
Left thumbstick position value
public Vector2 LeftThumbstickValue { get; }
Property Value
LeftTriggerValue
Left trigger pressed value
public float LeftTriggerValue { get; }
Property Value
RightThumbstickValue
Right thumbstick position value
public Vector2 RightThumbstickValue { get; }
Property Value
RightTriggerValue
Right trigger value
public float RightTriggerValue { get; }
Property Value
Methods
IsButtonDown(ControllerButtons)
Return true if the given button is current pressed
public bool IsButtonDown(ControllerButtons button)
Parameters
button
ControllerButtonsController Button (A, B, X, Y, etc)
Returns
- bool
Return true if the given button is current pressed
IsButtonPressed(ControllerButtons)
Return true if the given button was just pressed
public bool IsButtonPressed(ControllerButtons button)
Parameters
button
ControllerButtonsController Button (A, B, X, Y, etc)
Returns
- bool
Return true if the given button was just pressed
IsButtonReleased(ControllerButtons)
Return true if the given button was just released
public bool IsButtonReleased(ControllerButtons button)
Parameters
button
ControllerButtonsController Button (A, B, X, Y, etc)
Returns
IsButtonUp(ControllerButtons)
Return true if the given button is current released
public bool IsButtonUp(ControllerButtons button)
Parameters
button
ControllerButtonsController Button (A, B, X, Y, etc)
Returns
- bool
Return true if the given button is current released
SetVibration(float, float)
Vibrate the Controller (if available)
public void SetVibration(float leftMotor, float rightMotor)
Parameters
Events
Connected
Notification when Controller is connected or disconnected.
public event EventHandler<ControllerChangedEventArgs> Connected
Event Type
Disconnected
Notification when Controller lost its connection
public event EventHandler<ControllerChangedEventArgs> Disconnected