Table of Contents

Struct Gamepad.GamepadSnapshot

Namespace
BSGameLib.Game.Input
Assembly
BSGameLib.Game.dll

A copy of one gamepad's state at a moment. Read it with IsPressed(GamepadButton) and GetAxis(GamepadAxis).

public struct Gamepad.GamepadSnapshot
Inherited Members

Properties

Axes

The value of each axis, by axis.

public IReadOnlyDictionary<GamepadAxis, float> Axes { readonly get; init; }

Property Value

IReadOnlyDictionary<GamepadAxis, float>

Buttons

Whether each button is down, by button. A button not in the dictionary is up.

public IReadOnlyDictionary<GamepadButton, bool> Buttons { readonly get; init; }

Property Value

IReadOnlyDictionary<GamepadButton, bool>

InstanceId

The SDL instance id of the gamepad.

public int InstanceId { readonly get; init; }

Property Value

int

Name

The controller's name, as the platform reports it.

public string Name { readonly get; init; }

Property Value

string

Type

The kind of controller.

public GamepadType Type { readonly get; init; }

Property Value

GamepadType

Methods

GetAxis(GamepadAxis)

The value of axis, or 0 when the axis has no value.

public float GetAxis(GamepadAxis axis)

Parameters

axis GamepadAxis

Returns

float

IsPressed(GamepadButton)

Whether button is down.

public bool IsPressed(GamepadButton button)

Parameters

button GamepadButton

Returns

bool