diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /src/Ryujinx.Input/IGamepadDriver.cs | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'src/Ryujinx.Input/IGamepadDriver.cs')
| -rw-r--r-- | src/Ryujinx.Input/IGamepadDriver.cs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Ryujinx.Input/IGamepadDriver.cs b/src/Ryujinx.Input/IGamepadDriver.cs new file mode 100644 index 00000000..792aef00 --- /dev/null +++ b/src/Ryujinx.Input/IGamepadDriver.cs @@ -0,0 +1,37 @@ +using System; + +namespace Ryujinx.Input +{ + /// <summary> + /// Represent an emulated gamepad driver used to provide input in the emulator. + /// </summary> + public interface IGamepadDriver : IDisposable + { + /// <summary> + /// The name of the driver + /// </summary> + string DriverName { get; } + + /// <summary> + /// The unique ids of the gamepads connected. + /// </summary> + ReadOnlySpan<string> GamepadsIds { get; } + + /// <summary> + /// Event triggered when a gamepad is connected. + /// </summary> + event Action<string> OnGamepadConnected; + + /// <summary> + /// Event triggered when a gamepad is disconnected. + /// </summary> + event Action<string> OnGamepadDisconnected; + + /// <summary> + /// Open a gampad by its unique id. + /// </summary> + /// <param name="id">The unique id of the gamepad</param> + /// <returns>An instance of <see cref="IGamepad"/> associated to the gamepad id given or null if not found</returns> + IGamepad GetGamepad(string id); + } +} |
