mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-10-02 03:38:50 +02:00
misc: chore: Use collection expressions
This commit is contained in:
@@ -17,8 +17,8 @@ namespace Ryujinx.Input.SDL2
|
||||
|
||||
private StandardControllerInputConfig _configuration;
|
||||
|
||||
private static readonly SDL_GameControllerButton[] _buttonsDriverMapping = new SDL_GameControllerButton[(int)GamepadButtonInputId.Count]
|
||||
{
|
||||
private static readonly SDL_GameControllerButton[] _buttonsDriverMapping =
|
||||
[
|
||||
// Unbound, ignored.
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID,
|
||||
|
||||
@@ -53,19 +53,19 @@ namespace Ryujinx.Input.SDL2
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID,
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID,
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID,
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID,
|
||||
};
|
||||
SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_INVALID
|
||||
];
|
||||
|
||||
private readonly Lock _userMappingLock = new();
|
||||
|
||||
private readonly List<ButtonMappingEntry> _buttonsUserMapping;
|
||||
|
||||
private readonly StickInputId[] _stickUserMapping = new StickInputId[(int)StickInputId.Count]
|
||||
{
|
||||
private readonly StickInputId[] _stickUserMapping =
|
||||
[
|
||||
StickInputId.Unbound,
|
||||
StickInputId.Left,
|
||||
StickInputId.Right,
|
||||
};
|
||||
StickInputId.Right
|
||||
];
|
||||
|
||||
public GamepadFeaturesFlag Features { get; }
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ namespace Ryujinx.Input.SDL2
|
||||
private StandardKeyboardInputConfig _configuration;
|
||||
private readonly List<ButtonMappingEntry> _buttonsUserMapping;
|
||||
|
||||
private static readonly SDL_Keycode[] _keysDriverMapping = new SDL_Keycode[(int)Key.Count]
|
||||
{
|
||||
private static readonly SDL_Keycode[] _keysDriverMapping =
|
||||
[
|
||||
// INVALID
|
||||
SDL_Keycode.SDLK_0,
|
||||
// Presented as modifiers, so invalid here.
|
||||
@@ -165,15 +165,15 @@ namespace Ryujinx.Input.SDL2
|
||||
SDL_Keycode.SDLK_BACKSLASH,
|
||||
|
||||
// Invalids
|
||||
SDL_Keycode.SDLK_0,
|
||||
};
|
||||
SDL_Keycode.SDLK_0
|
||||
];
|
||||
|
||||
public SDL2Keyboard(SDL2KeyboardDriver driver, string id, string name)
|
||||
{
|
||||
_driver = driver;
|
||||
Id = id;
|
||||
Name = name;
|
||||
_buttonsUserMapping = new List<ButtonMappingEntry>();
|
||||
_buttonsUserMapping = [];
|
||||
}
|
||||
|
||||
private bool HasConfiguration => _configuration != null;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Ryujinx.Input.SDL2
|
||||
|
||||
public string DriverName => "SDL2";
|
||||
|
||||
private static readonly string[] _keyboardIdentifers = new string[1] { "0" };
|
||||
private static readonly string[] _keyboardIdentifers = ["0"];
|
||||
|
||||
public ReadOnlySpan<string> GamepadsIds => _keyboardIdentifers;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user