mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-13 09:08:34 +00:00
Added missing 'char' indexer for keyboards
This commit is contained in:
parent
102d8656bc
commit
69a9a122d0
@ -7,6 +7,7 @@ using System;
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using CUE.NET.Devices.Generic;
|
using CUE.NET.Devices.Generic;
|
||||||
|
using CUE.NET.Devices.Generic.Enums;
|
||||||
using CUE.NET.Native;
|
using CUE.NET.Native;
|
||||||
|
|
||||||
namespace CUE.NET.Devices.Keyboard
|
namespace CUE.NET.Devices.Keyboard
|
||||||
@ -23,6 +24,26 @@ namespace CUE.NET.Devices.Keyboard
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public CorsairKeyboardDeviceInfo KeyboardDeviceInfo { get; }
|
public CorsairKeyboardDeviceInfo KeyboardDeviceInfo { get; }
|
||||||
|
|
||||||
|
#region Indexers
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the <see cref="CorsairLed" /> representing the given character by calling the SDK-method 'CorsairGetLedIdForKeyName'.<br />
|
||||||
|
/// Note that this currently only works for letters.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="key">The character of the key.</param>
|
||||||
|
/// <returns>The led representing the given character or null if no led is found.</returns>
|
||||||
|
public CorsairLed this[char key]
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
CorsairLedId ledId = _CUESDK.CorsairGetLedIdForKeyName(key);
|
||||||
|
CorsairLed led;
|
||||||
|
return LedMapping.TryGetValue(ledId, out led) ? led : null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user