Vixen
02b45cc4
csharp
public interface IGamepad

One connected gamepad.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

State here is a snapshot of what the last pump saw, so reading an axis twice in a frame gives the same answer twice — which is what a simulation wants. Changes also arrive as events, and the two are consistent because they come from the same pump.

Fields and properties (6)

  • int DeviceId

    The id this device appears under in DeviceId.

  • string Name

    The device's name, for a settings screen.

  • GamepadKind Kind

    Which family it belongs to, for drawing the right button glyphs.

  • int PlayerIndex

    Which player slot the OS has assigned, or -1 where there is no such concept.

  • bool IsConnected

    Whether it is still plugged in.

  • IHaptics? Haptics

    Force feedback, or if it has none.

Methods (2)

  • float GetAxis(GamepadAxis axis)

    Reads an axis: [-1, 1] for sticks, [0, 1] for triggers.

  • bool IsButtonDown(GamepadButton button)

    Whether a button is held.

Used by (5)

  • DesktopGamepadVixen.Platform.Desktop
  • DesktopInputSourceVixen.Platform.Desktop
  • HeadlessInputSourceVixen.Platform.Headless
  • IInputSourceVixen.Platform
  • PlatformInputVixen.App.Hosting