ArcadeStick ArcadeStick ArcadeStick ArcadeStick Class

Definition

Represents an arcade stick.

public : sealed class ArcadeStick : IArcadeStick, IGameController, IGameControllerBatteryInfopublic sealed class ArcadeStick : IArcadeStick, IGameController, IGameControllerBatteryInfoPublic NotInheritable Class ArcadeStick Implements IArcadeStick, IGameController, IGameControllerBatteryInfo// You can use this class in JavaScript.
Attributes
Windows 10 requirements
Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)

Remarks

Instances of the ArcadeStick class cannot be created directly; instead, instances of the class are retrieved through the ArcadeStick.ArcadeSticks property listing all connected arcade sticks or through the ArcadeStick.ArcadeStickAdded event. See Arcade stick for more information about how to use the ArcadeStick class.

Supported Devices

ArcadeStick supports any Xbox One-certified or Xbox 360-compatible arcade stick.

Properties

ArcadeSticks ArcadeSticks ArcadeSticks ArcadeSticks

The list of all connected arcade sticks.

public : static IVectorView<ArcadeStick> ArcadeSticks { get; }public static IReadOnlyList<ArcadeStick> ArcadeSticks { get; }Public Static ReadOnly Property ArcadeSticks As IReadOnlyList<ArcadeStick>// You can use this property in JavaScript.
Value
IVectorView<ArcadeStick> IReadOnlyList<ArcadeStick> IReadOnlyList<ArcadeStick> IReadOnlyList<ArcadeStick>

The list of all connected arcade sticks.

Headset Headset Headset Headset

The audio headset attached to the arcade stick.

public : Headset Headset { get; }public Headset Headset { get; }Public ReadOnly Property Headset As Headset// You can use this property in JavaScript.
Value
Headset Headset Headset Headset

The audio headset attached to the arcade stick.

IsWireless IsWireless IsWireless IsWireless

Gets a value that indicates the wireless state of the arcade stick.

public : PlatForm::Boolean IsWireless { get; }public bool IsWireless { get; }Public ReadOnly Property IsWireless As bool// You can use this property in JavaScript.
Value
PlatForm::Boolean bool bool bool

True if the arcade stick is wireless. Otherwise, false.

User User User User

The user associated with the arcade stick.

public : User User { get; }public User User { get; }Public ReadOnly Property User As User// You can use this property in JavaScript.
Value
User User User User

The user associated with the arcade stick.

Methods

FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController) FromGameController(IGameController)

Returns the given game controller as an arcade stick.

public : static ArcadeStick FromGameController(IGameController gameController)public static ArcadeStick FromGameController(IGameController gameController)Public Static Function FromGameController(gameController As IGameController) As ArcadeStick// You can use this method in JavaScript.
Parameters
gameController
IGameController IGameController IGameController IGameController

The game controller to be returned as an arcade stick.

Returns

The arcade stick that was returned from the given game controller.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Examples

In the following example, the app gets the first available RawGameController object, and tries to access this game controller via the ArcadeStick class:

ArcadeStick^ arcadeStick;

if (RawGameController::RawGameControllers->Size > 0)
{
    RawGameController^ rawGameController = RawGameController::RawGameControllers->GetAt(0);
    arcadeStick = ArcadeStick::FromGameController(rawGameController);
}

if (arcadeStick != nullptr)
{
    // Assign a standard button mapping to this controller.
}

Remarks

This method checks if the provided game controller has an arcade stick implementation, and if so, it returns that implementation. You might use this method if you want to first get the controller as a RawGameController, and then see if it can be used as an ArcadeStick—if so, you can use a default control scheme for arcade sticks, otherwise you can let the player do their own input mapping.

GetButtonLabel(ArcadeStickButtons) GetButtonLabel(ArcadeStickButtons) GetButtonLabel(ArcadeStickButtons) GetButtonLabel(ArcadeStickButtons)

Retrieves the button label for the specified button.

public : GameControllerButtonLabel GetButtonLabel(ArcadeStickButtons button)public GameControllerButtonLabel GetButtonLabel(ArcadeStickButtons button)Public Function GetButtonLabel(button As ArcadeStickButtons) As GameControllerButtonLabel// You can use this method in JavaScript.
Parameters
button
ArcadeStickButtons ArcadeStickButtons ArcadeStickButtons ArcadeStickButtons

The button for which to retrieve the label.

Returns

Returns the label for the specified button. If the button label is blank or there is no known label for the controller’s button, then None is returned.

GetCurrentReading() GetCurrentReading() GetCurrentReading() GetCurrentReading()

Gets a snapshot of the arcade stick state.

public : ArcadeStickReading GetCurrentReading()public ArcadeStickReading GetCurrentReading()Public Function GetCurrentReading() As ArcadeStickReading// You can use this method in JavaScript.
Returns

TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport() TryGetBatteryReport()

Gets information about the arcade stick's current battery state.

public : BatteryReport TryGetBatteryReport()public BatteryReport TryGetBatteryReport()Public Function TryGetBatteryReport() As BatteryReport// You can use this method in JavaScript.
Returns

Information about the arcade stick's current battery state.

Additional features and requirements
Device family
Windows 10 Creators Update (introduced v10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v4)

Events

ArcadeStickAdded ArcadeStickAdded ArcadeStickAdded ArcadeStickAdded

Signals when a new arcade stick is connected.

public : static event EventHandler ArcadeStickAdded<ArcadeStick>public static event EventHandler ArcadeStickAdded<ArcadeStick>Public Static Event ArcadeStickAdded<ArcadeStick>// You can use this event in JavaScript.

Remarks

To identify controllers that have already been added, you query the list of connected controllers using ArcadeStick.ArcadeSticks.

ArcadeStickRemoved ArcadeStickRemoved ArcadeStickRemoved ArcadeStickRemoved

Signals when an arcade stick is disconnected.

public : static event EventHandler ArcadeStickRemoved<ArcadeStick>public static event EventHandler ArcadeStickRemoved<ArcadeStick>Public Static Event ArcadeStickRemoved<ArcadeStick>// You can use this event in JavaScript.

HeadsetConnected HeadsetConnected HeadsetConnected HeadsetConnected

Signals when a headset is attached to the arcade stick.

public : event TypedEventHandler HeadsetConnected<IGameController,  Headset>public event TypedEventHandler HeadsetConnected<IGameController,  Headset>Public Event HeadsetConnected<IGameController,  Headset>// You can use this event in JavaScript.

HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected HeadsetDisconnected

Signals when a headset is disconnected from the arcade stick.

public : event TypedEventHandler HeadsetDisconnected<IGameController,  Headset>public event TypedEventHandler HeadsetDisconnected<IGameController,  Headset>Public Event HeadsetDisconnected<IGameController,  Headset>// You can use this event in JavaScript.

UserChanged UserChanged UserChanged UserChanged

Signals when the user associated with the arcade stick has changed.

public : event TypedEventHandler UserChanged<IGameController,  UserChangedEventArgs>public event TypedEventHandler UserChanged<IGameController,  UserChangedEventArgs>Public Event UserChanged<IGameController,  UserChangedEventArgs>// You can use this event in JavaScript.