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
index
intThe axis index of the axis on this device
axis
GamePadAxisThe axis to map to
invert
boolShould axis be inverted
remap
boolRemap 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
index
intThe axis index of the axis on this device
button
GamePadButtonThe 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
index
intThe button index of the button on this device
axis
GamePadAxisThe axi to map to
invert
boolShould 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
index
intThe button index of the button on this device
button
GamePadButtonThe 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
a
Guidid a
b
Guidid b
numBytes
intnumber of bytes to compare, starting from
byteOffset
byteOffset
intstarting 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
targetDevice
IGamePadDeviceThe gamepad that events are mapped to
sourceDevice
IGameControllerDeviceThe 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
targetDevice
IGamePadDeviceThe gamepad that events are mapped to
sourceDevice
IGameControllerDeviceThe game controller that is mapped to a gamepad
controllerEvent
InputEventThe controller input event as a source
target
List<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
source
IInputSourceSource that this device comes from
device
IGameControllerDeviceThe device to match