using System.Globalization; using RGB.NET.Core; using RGB.NET.Devices.Wooting.Enum; using RGB.NET.Devices.Wooting.Generic; namespace RGB.NET.Devices.Wooting.Keyboard { /// /// /// Represents a generic information for a . /// public class WootingKeyboardRGBDeviceInfo : WootingRGBDeviceInfo { #region Properties & Fields /// /// Gets the of the . /// public WootingPhysicalKeyboardLayout PhysicalLayout { get; } /// /// Gets the of the . /// public WootingLogicalKeyboardLayout LogicalLayout { get; private set; } #endregion #region Constructors /// /// /// Internal constructor of managed . /// /// The index of the . /// The of the . /// The of the layout this keyboard is using internal WootingKeyboardRGBDeviceInfo(WootingDevicesIndexes deviceIndex, WootingPhysicalKeyboardLayout physicalKeyboardLayout, CultureInfo culture) : base(RGBDeviceType.Keyboard, deviceIndex) { this.PhysicalLayout = physicalKeyboardLayout; DetermineLogicalLayout(culture.KeyboardLayoutId); } private void DetermineLogicalLayout(int keyboardLayoutId) { switch (keyboardLayoutId) { // TODO SpoinkyNL 15-12-2019: There doesn't seem to be an accurate way to determine this, perhaps it should be a configurable thing.. // I'm using US International and it's reporting nl-NL's 1043. Also you can after all just swap your keycaps default: if (PhysicalLayout == WootingPhysicalKeyboardLayout.US) LogicalLayout = WootingLogicalKeyboardLayout.US; else LogicalLayout = WootingLogicalKeyboardLayout.UK; break; } } #endregion } }