Class GamePadLayout
Provides a IGameControllerDevice to IGamePadDevice mapping
public abstract class GamePadLayout
- Inheritance
-
GamePadLayout
- Derived
Fields
mapFirstPovToPad
Should direction controller 0 be mapped to the directional pad?
protected bool mapFirstPovToPad
Field Value
Methods
AddAxisToAxis(int, GamePadAxis, bool, bool)
Adds a mapping from an axis index to GamePadAxis
protected void AddAxisToAxis(int index, GamePadAxis axis, bool invert = false, bool remap = false)
Parameters
indexintThe axis index of the axis on this device
axisGamePadAxisThe axis to map to
invertboolShould axis be inverted
remapboolRemap this axis from (-1,1) to (0,1)
AddAxisToButton(int, GamePadButton)
Adds a mapping from an axis index to GamePadButton
protected void AddAxisToButton(int index, GamePadButton button)
Parameters
indexintThe axis index of the axis on this device
buttonGamePadButtonThe button(s) to map to
AddButtonToAxis(int, GamePadAxis, bool)
Adds a mapping from a button index to GamePadAxis
protected void AddButtonToAxis(int index, GamePadAxis axis, bool invert = false)
Parameters
indexintThe button index of the button on this device
axisGamePadAxisThe axi to map to
invertboolShould axis be inverted, output -1 instead of 1 on press
AddButtonToButton(int, GamePadButton)
Adds a mapping from a button index to GamePadButton
protected void AddButtonToButton(int index, GamePadButton button)
Parameters
indexintThe button index of the button on this device
buttonGamePadButtonThe button(s) to map to
CompareProductId(Guid, Guid, int, int)
Compares a product id
public static bool CompareProductId(Guid a, Guid b, int numBytes = 16, int byteOffset = 0)
Parameters
aGuidid a
bGuidid b
numBytesintnumber of bytes to compare, starting from
byteOffsetbyteOffsetintstarting byte index from where to compare
Returns
InitializeDevice(IGamePadDevice, IGameControllerDevice)
Allows the user to perform some additional setup operations when using this layout on a device
public virtual void InitializeDevice(IGamePadDevice targetDevice, IGameControllerDevice sourceDevice)
Parameters
targetDeviceIGamePadDeviceThe gamepad that events are mapped to
sourceDeviceIGameControllerDeviceThe game controller that is mapped to a gamepad
MapInputEvent(IGamePadDevice, IGameControllerDevice, InputEvent, List<InputEvent>)
Maps game controller events to gamepad events
public virtual void MapInputEvent(IGamePadDevice targetDevice, IGameControllerDevice sourceDevice, InputEvent controllerEvent, List<InputEvent> target)
Parameters
targetDeviceIGamePadDeviceThe gamepad that events are mapped to
sourceDeviceIGameControllerDeviceThe game controller that is mapped to a gamepad
controllerEventInputEventThe controller input event as a source
targetList<InputEvent>Target list
MatchDevice(IInputSource, IGameControllerDevice)
Checks if a device matches this gamepad layout, and thus should use this when mapping it to a GamePadState
public abstract bool MatchDevice(IInputSource source, IGameControllerDevice device)
Parameters
sourceIInputSourceSource that this device comes from
deviceIGameControllerDeviceThe device to match