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