See merge request ryubing/ryujinx!207
This commit is contained in:
Maki
2025-11-07 14:43:48 -06:00
committed by GreemDev
parent 13b69aedfe
commit a8ace3d23c
40 changed files with 1157 additions and 811 deletions

View File

@@ -0,0 +1,64 @@
using Ryujinx.SDL3.Common;
using System;
using System.Collections.Generic;
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");
}
public IEnumerable<IGamepad> GetGamepads()
{
foreach (string keyboardId in _keyboardIdentifers)
{
yield return GetGamepad(keyboardId);
}
}
}
}