mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2026-06-04 19:39:15 +00:00
20 lines
534 B
C#
20 lines
534 B
C#
namespace Ryujinx.Common.Configuration.Hid
|
|
{
|
|
public static class KeyboardKeyExtensions
|
|
{
|
|
public static Key ToKey(this PhysicalKey key)
|
|
{
|
|
return key is >= PhysicalKey.Unknown and < PhysicalKey.Count
|
|
? (Key)(int)key
|
|
: Key.Unknown;
|
|
}
|
|
|
|
public static PhysicalKey ToPhysicalKey(this Key key)
|
|
{
|
|
return key is >= Key.Unknown and < Key.Count
|
|
? (PhysicalKey)(int)key
|
|
: PhysicalKey.Unknown;
|
|
}
|
|
}
|
|
}
|