1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 16:58:29 +00:00

Added missing 'char' indexer for keyboards

This commit is contained in:
Darth Affe 2016-09-11 19:36:57 +02:00
parent 102d8656bc
commit 69a9a122d0

View File

@ -7,6 +7,7 @@ using System;
using System.Drawing;
using System.Runtime.InteropServices;
using CUE.NET.Devices.Generic;
using CUE.NET.Devices.Generic.Enums;
using CUE.NET.Native;
namespace CUE.NET.Devices.Keyboard
@ -23,6 +24,26 @@ namespace CUE.NET.Devices.Keyboard
/// </summary>
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
#region Constructors