Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    IGamePadDevice Interface

    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
    Name Description
    Properties
    CanChangeIndex

    true if the index of this gamepad can be changed

    DownButtons

    The gamepad buttons that are down

    Index

    The index of the gamepad assigned by the input manager

    PressedButtons

    The gamepad buttons that have been pressed since the last frame

    ProductId

    Product Id of the device

    ReleasedButtons

    The gamepad buttons that have been released since the last frame

    State

    The state of the gamepad

    Methods
    SetVibration(Single, Single, Single, Single)

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

    Events
    IndexChanged

    Raised if the index assigned to this gamepad changed

    | Improve this Doc View Source

    Properties


    CanChangeIndex

    true if the index of this gamepad can be changed

    bool CanChangeIndex { get; }
    Property Value
    Type Description
    System.Boolean

    DownButtons

    The gamepad buttons that are down

    IReadOnlySet<GamePadButton> DownButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<GamePadButton>

    Index

    The index of the gamepad assigned by the input manager

    int Index { get; set; }
    Property Value
    Type Description
    System.Int32
    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
    Type Description
    IReadOnlySet<GamePadButton>

    ProductId

    Product Id of the device

    Guid ProductId { get; }
    Property Value
    Type Description
    System.Guid

    ReleasedButtons

    The gamepad buttons that have been released since the last frame

    IReadOnlySet<GamePadButton> ReleasedButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<GamePadButton>

    State

    The state of the gamepad

    GamePadState State { get; }
    Property Value
    Type Description
    GamePadState
    | Improve this Doc View Source

    Methods


    SetVibration(Single, Single, Single, Single)

    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
    Type Name Description
    System.Single smallLeft

    The small left side motor

    System.Single smallRight

    The small right side motor

    System.Single largeLeft

    The large left side motor

    System.Single largeRight

    The large right side motor

    Remarks

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

    | Improve this Doc View Source

    Events


    IndexChanged

    Raised if the index assigned to this gamepad changed

    event EventHandler<GamePadIndexChangedEventArgs> IndexChanged
    Event Type
    Type Description
    System.EventHandler<GamePadIndexChangedEventArgs>

    Inherited Members

    IInputDevice.Name
    IInputDevice.Id
    IInputDevice.Priority
    IInputDevice.Source
    IInputDevice.Update(List<InputEvent>)

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    GamePadDeviceExtensions.SetVibration(IGamePadDevice, Single)
    GamePadDeviceExtensions.SetVibration(IGamePadDevice, Single, Single)
    GamePadDeviceExtensions.IsButtonPressed(IGamePadDevice, GamePadButton)
    GamePadDeviceExtensions.IsButtonReleased(IGamePadDevice, GamePadButton)
    GamePadDeviceExtensions.IsButtonDown(IGamePadDevice, GamePadButton)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation