Table of Contents

Interface IGamePadDevice

Namespace
Stride.Input
Assembly
Stride.Input.dll

A gamepad is a game controller that has a fixed button mapping, stored in State

public interface IGamePadDevice : IInputDevice
Inherited Members
Extension Methods

Properties

CanChangeIndex

true if the index of this gamepad can be changed

bool CanChangeIndex { get; }

Property Value

bool

DownButtons

The gamepad buttons that are down

IReadOnlySet<GamePadButton> DownButtons { get; }

Property Value

IReadOnlySet<GamePadButton>

Index

The index of the gamepad assigned by the input manager

int Index { get; set; }

Property Value

int

Remarks

If CanChangeIndex is false, this value can not be changed

PressedButtons

The gamepad buttons that have been pressed since the last frame

IReadOnlySet<GamePadButton> PressedButtons { get; }

Property Value

IReadOnlySet<GamePadButton>

ProductId

Product Id of the device

Guid ProductId { get; }

Property Value

Guid

ReleasedButtons

The gamepad buttons that have been released since the last frame

IReadOnlySet<GamePadButton> ReleasedButtons { get; }

Property Value

IReadOnlySet<GamePadButton>

State

The state of the gamepad

GamePadState State { get; }

Property Value

GamePadState

Methods

SetVibration(float, float, float, float)

Sets 4 vibration motors one the device or approximates the effect if less are supported

void SetVibration(float smallLeft, float smallRight, float largeLeft, float largeRight)

Parameters

smallLeft float

The small left side motor

smallRight float

The small right side motor

largeLeft float

The large left side motor

largeRight float

The large right side motor

Remarks

Values range from 0 to 1, where 0 is off and 1 is maximum vibration

Events

IndexChanged

Raised if the index assigned to this gamepad changed

event EventHandler<GamePadIndexChangedEventArgs> IndexChanged

Event Type

EventHandler<GamePadIndexChangedEventArgs>