GameControllerFactoryManager
GameControllerFactoryManager
GameControllerFactoryManager
GameControllerFactoryManager
Class
Definition
Manages factories for custom controllers.
public : static class GameControllerFactoryManagerpublic static class GameControllerFactoryManagerPublic Static Class GameControllerFactoryManager// This API is not available in Javascript.
- Attributes
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
Methods
RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory, Guid) RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory, Guid) RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory, Guid) RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory, Guid)
Registers a factory for a custom Gip controller.
public : static void RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory factory, PlatForm::Guid interfaceId)public static void RegisterCustomFactoryForGipInterface(ICustomGameControllerFactory factory, Guid interfaceId)Public Static Function RegisterCustomFactoryForGipInterface(factory As ICustomGameControllerFactory, interfaceId As Guid) As void// This API is not available in Javascript.
- factory
- ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory
The factory to register.
- interfaceId
- PlatForm::Guid Guid Guid Guid
The interface ID of the factory.
RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory, UInt16, UInt16) RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory, UInt16, UInt16) RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory, UInt16, UInt16) RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory, UInt16, UInt16)
Registers a factory for a custom hardware ID controller.
public : static void RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory factory, unsigned short hardwareVendorId, unsigned short hardwareProductId)public static void RegisterCustomFactoryForHardwareId(ICustomGameControllerFactory factory, UInt16 hardwareVendorId, UInt16 hardwareProductId)Public Static Function RegisterCustomFactoryForHardwareId(factory As ICustomGameControllerFactory, hardwareVendorId As UInt16, hardwareProductId As UInt16) As void// This API is not available in Javascript.
- factory
- ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory
The factory to register.
- hardwareVendorId
- unsigned short UInt16 UInt16 UInt16
The hardware vendor ID.
- hardwareProductId
- unsigned short UInt16 UInt16 UInt16
The hardware product ID.
RegisterCustomFactoryForXusbType(ICustomGameControllerFactory, XusbDeviceType, XusbDeviceSubtype) RegisterCustomFactoryForXusbType(ICustomGameControllerFactory, XusbDeviceType, XusbDeviceSubtype) RegisterCustomFactoryForXusbType(ICustomGameControllerFactory, XusbDeviceType, XusbDeviceSubtype) RegisterCustomFactoryForXusbType(ICustomGameControllerFactory, XusbDeviceType, XusbDeviceSubtype)
Registers a factory for a Xusb type controller.
public : static void RegisterCustomFactoryForXusbType(ICustomGameControllerFactory factory, XusbDeviceType xusbType, XusbDeviceSubtype xusbSubtype)public static void RegisterCustomFactoryForXusbType(ICustomGameControllerFactory factory, XusbDeviceType xusbType, XusbDeviceSubtype xusbSubtype)Public Static Function RegisterCustomFactoryForXusbType(factory As ICustomGameControllerFactory, xusbType As XusbDeviceType, xusbSubtype As XusbDeviceSubtype) As void// This API is not available in Javascript.
- factory
- ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory
The factory to register.
The Xusb device type.
The Xusb device subtype.
TryGetFactoryControllerFromGameController(ICustomGameControllerFactory, IGameController) TryGetFactoryControllerFromGameController(ICustomGameControllerFactory, IGameController) TryGetFactoryControllerFromGameController(ICustomGameControllerFactory, IGameController) TryGetFactoryControllerFromGameController(ICustomGameControllerFactory, IGameController)
Tries to get a game controller that belongs to the specified factory and references the same underlying game controller as the one that was specified.
public : static IGameController TryGetFactoryControllerFromGameController(ICustomGameControllerFactory factory, IGameController gameController)public static IGameController TryGetFactoryControllerFromGameController(ICustomGameControllerFactory factory, IGameController gameController)Public Static Function TryGetFactoryControllerFromGameController(factory As ICustomGameControllerFactory, gameController As IGameController) As IGameController// This API is not available in Javascript.
- factory
- ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory ICustomGameControllerFactory
The factory for the type of game controller that you want to get.
- gameController
- IGameController IGameController IGameController IGameController
The game controller that references the underlying device for which you want to get another game controller representation.
If found, a game controller that belongs to the specified factory and references the same underlying device as the specified game controller; otherwise, null.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
This method provides the implementation for each game controller class's FromGameController method. A class's FromGameController method allows you to pass in an instance of one game controller class, and get an object from another game controller class that references the same underlying device. For example, if you have an ArcadeStick and you want to get a RawGameController representation of that same underlying controller, you would call RawGameController.FromGameController, passing in the ArcadeStick (which you can do, since the method takes an IGameController object, and ArcadeStick inherits from IGameController). Your custom game controller classes must also inherit from IGameController.
Since each game controller class implements ICustomGameControllerFactory (including your own custom classes), you can pass the factory for the game controller class that you want into GameControllerFactoryManager.TryGetFactoryControllerFromGameController, and then the GameControllerFactoryManager can try to return an object of that class that references the same underlying device as the game controller that you specified.