Merge pull request #448 from megabytesme/logitech-per-key-fix

Initialise LED layout in constructor of LogitechPerKeyRGBDevice class
This commit is contained in:
DarthAffe authored and GitHub committed 2026-03-19 22:50:11 +01:00
commit b7665b00e1
1 file changed
+11 -1
@@ -24,14 +24,24 @@ public sealed class LogitechPerKeyRGBDevice : LogitechRGBDevice<LogitechRGBDevic
: base(info, updateQueue)
{
this._ledMapping = ledMapping;
InitializeLayout();
}
#endregion
#region Methods
private void InitializeLayout()
{
int pos = 0;
foreach ((LedId ledId, LogitechLedId mapping) in _ledMapping)
AddLed(ledId, new Point(pos++ * 19, 0), new Size(19, 19));
}
/// <inheritdoc />
protected override object GetLedCustomData(LedId ledId) => _ledMapping.TryGetValue(ledId, out LogitechLedId logitechLedId) ? logitechLedId : -1;
#endregion
}