mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 13:06:24 +00:00
Added physical-layout to KeyboardDeviceInfo
This commit is contained in:
1 parent
07a6d8952c
commit
190f5df025
16 files changed
+100
-50
No files matched your search
@@ -15,6 +15,12 @@ namespace RGB.NET.Devices.Corsair
|
||||
/// </summary>
|
||||
public class CorsairKeyboardRGBDevice : CorsairRGBDevice<CorsairKeyboardRGBDeviceInfo>, IKeyboard
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
IKeyboardDeviceInfo IKeyboard.DeviceInfo => DeviceInfo;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -7,14 +7,16 @@ using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.Corsair.CorsairKeyboardRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CorsairKeyboardRGBDeviceInfo : CorsairRGBDeviceInfo
|
||||
public class CorsairKeyboardRGBDeviceInfo : CorsairRGBDeviceInfo, IKeyboardDeviceInfo
|
||||
{
|
||||
#region Properties & Fields
|
||||
|
||||
/// <inheritdoc />
|
||||
public KeyboardLayoutType Layout { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the physical layout of the keyboard.
|
||||
/// </summary>
|
||||
@@ -41,6 +43,15 @@ namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
this.PhysicalLayout = (CorsairPhysicalKeyboardLayout)nativeInfo.physicalLayout;
|
||||
this.LogicalLayout = (CorsairLogicalKeyboardLayout)nativeInfo.logicalLayout;
|
||||
this.Layout = PhysicalLayout switch
|
||||
{
|
||||
CorsairPhysicalKeyboardLayout.US => KeyboardLayoutType.Ansi,
|
||||
CorsairPhysicalKeyboardLayout.UK => KeyboardLayoutType.Iso,
|
||||
CorsairPhysicalKeyboardLayout.BR => KeyboardLayoutType.Unknown,
|
||||
CorsairPhysicalKeyboardLayout.JP => KeyboardLayoutType.Jis,
|
||||
CorsairPhysicalKeyboardLayout.KR => KeyboardLayoutType.Unknown,
|
||||
_ => KeyboardLayoutType.Unknown
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user