mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-20 17:51:13 +02:00
- Fix: Crash when connecting a JoyCon - Fix: Make controller GUIDs match old SDL2 GUIDs - Fix: Detect face button layout for gamepads Co-authored-by: Maki <77-maki@users.noreply.git.ryujinx.app>
56 lines
1.2 KiB
C#
56 lines
1.2 KiB
C#
using Ryujinx.SDL3.Common;
|
|
using System;
|
|
|
|
namespace Ryujinx.Input.SDL3
|
|
{
|
|
public class SDL3KeyboardDriver : IGamepadDriver
|
|
{
|
|
public SDL3KeyboardDriver()
|
|
{
|
|
SDL3Driver.Instance.Initialize();
|
|
}
|
|
|
|
public string DriverName => "SDL3";
|
|
|
|
private static readonly string[] _keyboardIdentifers = ["0"];
|
|
|
|
public ReadOnlySpan<string> GamepadsIds => _keyboardIdentifers;
|
|
|
|
public event Action<string> OnGamepadConnected
|
|
{
|
|
add { }
|
|
remove { }
|
|
}
|
|
|
|
public event Action<string> OnGamepadDisconnected
|
|
{
|
|
add { }
|
|
remove { }
|
|
}
|
|
|
|
protected virtual void Dispose(bool disposing)
|
|
{
|
|
if (disposing)
|
|
{
|
|
SDL3Driver.Instance.Dispose();
|
|
}
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
GC.SuppressFinalize(this);
|
|
Dispose(true);
|
|
}
|
|
|
|
public IGamepad GetGamepad(string id)
|
|
{
|
|
if (!_keyboardIdentifers[0].Equals(id))
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return new SDL3Keyboard(this, _keyboardIdentifers[0], "All keyboards");
|
|
}
|
|
}
|
|
}
|