RacingWheel RacingWheel RacingWheel RacingWheel Class

Definition

Represents a racing wheel.

public : sealed class RacingWheel : IGameController, IGameControllerBatteryInfo, IRacingWheelpublic sealed class RacingWheel : IGameController, IGameControllerBatteryInfo, IRacingWheelPublic NotInheritable Class RacingWheel Implements IGameController, IGameControllerBatteryInfo, IRacingWheel// 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

Supported Devices

RacingWheel supports any Xbox One-certified or Xbox 360-compatible racing wheel without force feedback support.

Force feedback is supported on the following device models:

ManufacturerModel
LogitechG25
G27
G29
G920
MOMO Force Feedback Racing Wheel
ThrustmasterT300RS
T500RS
RGT Force Feedback
T150
TX
TMX
FanatecCSR
HID-mode for the Xbox One

Note that to use the devices listed above you should include a HID (Human Interface Device) capability declaration in your app's appxmanifest:


<Capabilities>
  <DeviceCapability Name="humaninterfacedevice">
    <Device Id="any">
      <Function Type="usage:0001 0004"/>
      <Function Type="usage:0001 0005"/>
    </Device>
  </DeviceCapability>
</Capabilities>          

Properties

HasClutch HasClutch HasClutch HasClutch

Boolean indicating whether the racing wheel has a clutch.

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

Boolean indicating whether the racing wheel has a clutch.

HasHandbrake HasHandbrake HasHandbrake HasHandbrake

Boolean indicating whether the racing wheel has a handbrake.

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

Boolean indicating whether the racing wheel has a handbrake.

HasPatternShifter HasPatternShifter HasPatternShifter HasPatternShifter

Boolean indicating whether the racing wheel has a pattern shifter.

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

Boolean indicating whether the racing wheel has a pattern shifter.

Headset Headset Headset Headset

The audio headset attached to the racing wheel.

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 racing wheel.

IsWireless IsWireless IsWireless IsWireless

Gets a value that indicates the wireless state of the racing wheel.

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 gamepad is wireless. Otherwise, false.

MaxPatternShifterGear MaxPatternShifterGear MaxPatternShifterGear MaxPatternShifterGear

The highest gear of the shifter.

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

The highest gear of the shifter.

MaxWheelAngle MaxWheelAngle MaxWheelAngle MaxWheelAngle

The maximum angle, in degrees, of the racing wheel.

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

The maximum angle, in degrees, of the racing wheel.

RacingWheels RacingWheels RacingWheels RacingWheels

The list of all connected racing wheels.

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

The list of all connected racing wheels.

User User User User

The user associated with the racing wheel.

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 racing wheel.

WheelMotor WheelMotor WheelMotor WheelMotor

The force feedback motor for the racing wheel.

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

The force feedback motor for the racing wheel. If the controller does not support force feedback, this property will be null.

Remarks

Force feedback is only supported for selected HID (Human Interface Device) controllers. Xbox 360 and Xbox One racing wheels do not support force feedback in Windows 10 at this time.

Methods

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

Returns the given game controller as a racing wheel.

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

The game controller to be returned as a racing wheel.

Returns

The racing wheel 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 RacingWheel class:

RacingWheel^ racingWheel;

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

    racingWheel = RacingWheel::FromGameController(rawGameController);
}

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

Remarks

This method checks if the provided game controller has a racing wheel 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 a RacingWheel—if so, you can use a default control scheme for racing wheels, otherwise you can let the player do their own input mapping.

GetButtonLabel(RacingWheelButtons) GetButtonLabel(RacingWheelButtons) GetButtonLabel(RacingWheelButtons) GetButtonLabel(RacingWheelButtons)

Retrieves the button label for the specified button.

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

The button for which to retrieve the label.

Returns

Returns the button 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 racing wheel's state.

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

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

Gets information about the racing wheel'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 racing wheel'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

HeadsetConnected HeadsetConnected HeadsetConnected HeadsetConnected

Signals when a headset is attached to the racing wheel.

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 racing wheel.

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

RacingWheelAdded RacingWheelAdded RacingWheelAdded RacingWheelAdded

Signals when a new racing wheel is connected.

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

Remarks

To identify racing wheels that have already been added, you query the list of connected racing wheels using RacingWheel.RacingWheels.

RacingWheelRemoved RacingWheelRemoved RacingWheelRemoved RacingWheelRemoved

Signals when a racing wheel is disconnected.

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

UserChanged UserChanged UserChanged UserChanged

Signals when the user associated with the racing wheel 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.

See Also