IGamepadDriver.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. namespace Ryujinx.Input
  3. {
  4. /// <summary>
  5. /// Represent an emulated gamepad driver used to provide input in the emulator.
  6. /// </summary>
  7. public interface IGamepadDriver : IDisposable
  8. {
  9. /// <summary>
  10. /// The name of the driver
  11. /// </summary>
  12. string DriverName { get; }
  13. /// <summary>
  14. /// The unique ids of the gamepads connected.
  15. /// </summary>
  16. ReadOnlySpan<string> GamepadsIds { get; }
  17. /// <summary>
  18. /// Event triggered when a gamepad is connected.
  19. /// </summary>
  20. event Action<string> OnGamepadConnected;
  21. /// <summary>
  22. /// Event triggered when a gamepad is disconnected.
  23. /// </summary>
  24. event Action<string> OnGamepadDisconnected;
  25. /// <summary>
  26. /// Open a gampad by its unique id.
  27. /// </summary>
  28. /// <param name="id">The unique id of the gamepad</param>
  29. /// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns>
  30. IGamepad GetGamepad(string id);
  31. }
  32. }