mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
UI - Added keyboard layout selection UI
This commit is contained in:
1 parent
ea1633c322
commit
46d3a288e9
20 files changed
+460
-12
No files matched your search
@@ -306,7 +306,7 @@ namespace Artemis.Core
|
||||
{
|
||||
// Take out invalid file name chars, may not be perfect but neither are you
|
||||
string fileName = System.IO.Path.GetInvalidFileNameChars().Aggregate(RgbDevice.DeviceInfo.Model, (current, c) => current.Replace(c, '-'));
|
||||
if (RgbDevice is IKeyboard)
|
||||
if (RgbDevice.DeviceInfo.DeviceType == RGBDeviceType.Keyboard)
|
||||
fileName = $"{fileName}-{PhysicalLayout.ToString().ToUpper()}";
|
||||
if (includeExtension)
|
||||
fileName = $"{fileName}.xml";
|
||||
@@ -388,9 +388,10 @@ namespace Artemis.Core
|
||||
|
||||
private void ApplyKeyboardLayout()
|
||||
{
|
||||
if (!(RgbDevice is IKeyboard keyboard))
|
||||
if (RgbDevice.DeviceInfo.DeviceType != RGBDeviceType.Keyboard)
|
||||
return;
|
||||
|
||||
IKeyboard keyboard = (IKeyboard) RgbDevice;
|
||||
// If supported, detect the device layout so that we can load the correct one
|
||||
if (DeviceProvider.CanDetectLogicalLayout)
|
||||
LogicalLayout = DeviceProvider.GetLogicalLayout(keyboard);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using RGB.NET.Core;
|
||||
|
||||
|
||||
Reference in new issue
Block a user