GamePadState.IsConnected Property

Indicates whether the Xbox 360 Controller is connected.

Namespace: Microsoft.Xna.Framework.Input
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)


public bool IsConnected { get; }

Property Value

true if the controller is connected; false otherwise.


When calling GetState or GetCapabilities, check the returned structure's IsConnected property value. If the controller has been disconnected, this value will be false. When a controller is disconnected, values for its state and/or capabilities will not be valid. The controller will also not be able to receive new vibration settings.

See Also


Detecting Xbox 360 Controller Button Presses (Xbox 360, Windows)
Determining If an Xbox 360 Controller Is Disconnected (Xbox 360, Windows)


Overview of User Input and Input Devices


GamePadState Structure
GamePadState Members
Microsoft.Xna.Framework.Input Namespace


Xbox 360, Windows 7, Windows Vista, Windows XP, Windows Phone