Joystick Class (Microsoft.Xna.Framework.Input)

Allows interaction with joysticks. Unlike GamePad the number of Buttons/Axes/DPads is not limited.

Namespace: Microsoft.Xna.Framework.Input
Assembly: MonoGame.Framework (MonoGame.Framework.dll
  • C#
  • VB
  • F#
public static class Joystick

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The Joystick type exposes the following members.

  Platforms Name Description
IsSupported Gets a value indicating whether the current platform supports reading raw joystick data. 
LastConnectedIndex Gets a value indicating the last joystick index connected to the system. If this value is less than 0, no joysticks are connected. The order joysticks are connected and disconnected determines their index. As such, this value may be larger than 0 even if only one joystick is connected.  
  Platforms Name Description
GetCapabilities Gets the capabilites of the joystick. 
GetState(int) Gets the current state of the joystick. 
GetState(JoystickState, int) Gets the current state of the joystick by updating an existing JoystickState
Supported in:

 Windows DirectX Desktop
 Linux Desktop
 Windows OpenGL Desktop