Table of Contents

Class GamePadLayout

Namespace
Stride.Input
Assembly
Stride.Input.dll

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

bool

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 int

The axis index of the axis on this device

axis GamePadAxis

The axis to map to

invert bool

Should axis be inverted

remap bool

Remap 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 int

The axis index of the axis on this device

button GamePadButton

The 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 int

The button index of the button on this device

axis GamePadAxis

The axi to map to

invert bool

Should 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 int

The button index of the button on this device

button GamePadButton

The 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 Guid

id a

b Guid

id b

numBytes int

number of bytes to compare, starting from byteOffset

byteOffset int

starting byte index from where to compare

Returns

bool

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 IGamePadDevice

The gamepad that events are mapped to

sourceDevice IGameControllerDevice

The 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 IGamePadDevice

The gamepad that events are mapped to

sourceDevice IGameControllerDevice

The game controller that is mapped to a gamepad

controllerEvent InputEvent

The 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 IInputSource

Source that this device comes from

device IGameControllerDevice

The device to match

Returns

bool