mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-03-23 23:38:45 +00:00
Merge pull request #448 from megabytesme/logitech-per-key-fix
Initialise LED layout in constructor of LogitechPerKeyRGBDevice class
This commit is contained in:
commit
b7665b00e1
@ -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
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user