aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx/Input/GTK3/GTK3MappingHelper.cs
diff options
context:
space:
mode:
authorNicholas Rodine <halfofastaple@gmail.com>2022-08-17 19:00:27 -0500
committerGitHub <noreply@github.com>2022-08-18 02:00:27 +0200
commiteb6430f10341909704e6891b4ded633b6ce1e47a (patch)
tree27959f87ee52750f7107cc65ec2f7380e81859f0 /Ryujinx/Input/GTK3/GTK3MappingHelper.cs
parent80a879cb447507822e19acb0e51e123b768acd61 (diff)
Skipped over the last "Count" key explicitly, instead of relying on an exception. (#3595)1.1.222
Diffstat (limited to 'Ryujinx/Input/GTK3/GTK3MappingHelper.cs')
-rw-r--r--Ryujinx/Input/GTK3/GTK3MappingHelper.cs14
1 files changed, 4 insertions, 10 deletions
diff --git a/Ryujinx/Input/GTK3/GTK3MappingHelper.cs b/Ryujinx/Input/GTK3/GTK3MappingHelper.cs
index 1035e415..7a72a609 100644
--- a/Ryujinx/Input/GTK3/GTK3MappingHelper.cs
+++ b/Ryujinx/Input/GTK3/GTK3MappingHelper.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Linq;
using System.Runtime.CompilerServices;
using GtkKey = Gdk.Key;
@@ -150,22 +151,15 @@ namespace Ryujinx.Input.GTK3
static GTK3MappingHelper()
{
- var inputKeys = Enum.GetValues<Key>();
+ var inputKeys = Enum.GetValues<Key>().SkipLast(1);
// GtkKey is not contiguous and quite large, so use a dictionary instead of an array.
_gtkKeyMapping = new Dictionary<GtkKey, Key>();
foreach (var key in inputKeys)
{
- try
- {
- var index = ToGtkKey((Key)key);
- _gtkKeyMapping[index] = (Key)key;
- }
- catch
- {
- // Skip invalid mappings.
- }
+ var index = ToGtkKey(key);
+ _gtkKeyMapping[index] = key;
}
}