Struct Gamepad.GamepadSnapshot
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
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
InstanceId
The SDL instance id of the gamepad.
public int InstanceId { readonly get; init; }
Property Value
Name
The controller's name, as the platform reports it.
public string Name { readonly get; init; }
Property Value
Type
The kind of controller.
public GamepadType Type { readonly get; init; }
Property Value
Methods
GetAxis(GamepadAxis)
The value of axis, or 0 when the axis has no value.
public float GetAxis(GamepadAxis axis)
Parameters
axisGamepadAxis
Returns
IsPressed(GamepadButton)
Whether button is down.
public bool IsPressed(GamepadButton button)
Parameters
buttonGamepadButton