misc: chore: Use explicit types in the Avalonia project

This commit is contained in:
Evan Husted 2025-01-25 14:00:23 -06:00
parent 3b5f6170d1
commit be3bd0bcb5
69 changed files with 367 additions and 348 deletions

View file

@ -91,7 +91,7 @@ namespace Ryujinx.Ava.Input
return false;
}
AvaloniaKeyboardMappingHelper.TryGetAvaKey(key, out var nativeKey);
AvaloniaKeyboardMappingHelper.TryGetAvaKey(key, out AvaKey nativeKey);
return _pressedKeys.Contains(nativeKey);
}

View file

@ -150,14 +150,14 @@ namespace Ryujinx.Ava.Input
static AvaloniaKeyboardMappingHelper()
{
var inputKeys = Enum.GetValues<Key>();
Key[] inputKeys = Enum.GetValues<Key>();
// NOTE: Avalonia.Input.Key is not contiguous and quite large, so use a dictionary instead of an array.
_avaKeyMapping = new Dictionary<AvaKey, Key>();
foreach (var key in inputKeys)
foreach (Key key in inputKeys)
{
if (TryGetAvaKey(key, out var index))
if (TryGetAvaKey(key, out AvaKey index))
{
_avaKeyMapping[index] = key;
}