Stride

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

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

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

    IGameControllerDevice Interface

    Namespace: Stride.Input
    Assembly: Stride.Input.dll

    This interface is used for interacting with game controller devices.

    public interface IGameControllerDevice : IInputDevice
    Name Description
    Properties
    AxisInfos

    Information about the axes on this game controller

    ButtonInfos

    Information about the buttons on this game controller

    DirectionInfos

    Information about the direction controllers on this game controller

    DownButtons

    The buttons that are down

    PressedButtons

    The buttons that have been pressed since the last frame

    ProductId

    Product Id of the device

    ReleasedButtons

    The buttons that have been released since the last frame

    Methods
    GetAxis(Int32)

    Retrieves the state of a single axis

    GetDirection(Int32)

    Retrieves the state of a single point of direction controller

    | Improve this Doc View Source

    Properties


    AxisInfos

    Information about the axes on this game controller

    IReadOnlyList<GameControllerAxisInfo> AxisInfos { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<GameControllerAxisInfo>

    ButtonInfos

    Information about the buttons on this game controller

    IReadOnlyList<GameControllerButtonInfo> ButtonInfos { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<GameControllerButtonInfo>

    DirectionInfos

    Information about the direction controllers on this game controller

    IReadOnlyList<GameControllerDirectionInfo> DirectionInfos { get; }
    Property Value
    Type Description
    System.Collections.Generic.IReadOnlyList<GameControllerDirectionInfo>

    DownButtons

    The buttons that are down

    IReadOnlySet<int> DownButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<System.Int32>

    PressedButtons

    The buttons that have been pressed since the last frame

    IReadOnlySet<int> PressedButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<System.Int32>

    ProductId

    Product Id of the device

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

    ReleasedButtons

    The buttons that have been released since the last frame

    IReadOnlySet<int> ReleasedButtons { get; }
    Property Value
    Type Description
    IReadOnlySet<System.Int32>
    | Improve this Doc View Source

    Methods


    GetAxis(Int32)

    Retrieves the state of a single axis

    float GetAxis(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The axis' index, as exposed in AxisInfos

    Returns
    Type Description
    System.Single

    The value read directly from the axis


    GetDirection(Int32)

    Retrieves the state of a single point of direction controller

    Direction GetDirection(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The direction controller's index, as exposed in DirectionInfos

    Returns
    Type Description
    Direction

    The current state of the direction controller


    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)
    GameControllerExtensions.GetButtonCount(IGameControllerDevice)
    GameControllerExtensions.GetAxisCount(IGameControllerDevice)
    GameControllerExtensions.GetDirectionCount(IGameControllerDevice)
    GameControllerExtensions.GetDPad(IGameControllerDevice, Int32)
    GameControllerDeviceExtensions.IsButtonPressed(IGameControllerDevice, Int32)
    GameControllerDeviceExtensions.IsButtonReleased(IGameControllerDevice, Int32)
    GameControllerDeviceExtensions.IsButtonDown(IGameControllerDevice, Int32)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

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