public void Flash4(Color burstcol, int speed, CancellationToken cts, string[] regions)
        {
            if (!_logitechDeviceKeyboard)
            {
                return;
            }

            if (!_logiFlash4Running)
            {
                foreach (var key in regions)
                {
                    LogitechSdkWrapper.LogiLedSaveLightingForKey(ToKeyboardNames(key));
                }

                _logiFlash4Running = true;
                _logiFlash4Step    = 0;
            }

            if (_logiFlash4Running)
            {
                while (_logiFlash4Running)
                {
                    if (cts.IsCancellationRequested)
                    {
                        break;
                    }

                    if (_logiFlash4Step == 0)
                    {
                        if (_logitechDeviceKeyboard)
                        {
                            foreach (var key in regions)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                        }

                        _logiFlash4Step = 1;

                        Thread.Sleep(speed);
                    }
                    else if (_logiFlash4Step == 1)
                    {
                        if (_logitechDeviceKeyboard)
                        {
                            foreach (var key in regions)
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }

                        _logiFlash4Step = 0;

                        Thread.Sleep(speed);
                    }
                }
            }
        }
        public void Flash1(Color burstcol, int speed, string[] regions)
        {
            if (!_logitechDeviceKeyboard)
            {
                return;
            }

            for (var i = 0; i <= 8; i++)
            {
                if (i == 0)
                {
                    foreach (var key in regions)
                    {
                        LogitechSdkWrapper.LogiLedSaveLightingForKey(ToKeyboardNames(key));
                    }
                }
                else if (i == 1)
                {
                    foreach (var key in regions)
                    {
                        ApplyMapKeyLighting(key, burstcol, false);
                    }
                }
                else if (i == 2)
                {
                    foreach (var key in regions)
                    {
                        LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                    }
                }
                else if (i == 3)
                {
                    foreach (var key in regions)
                    {
                        ApplyMapKeyLighting(key, burstcol, false);
                    }
                }
                else if (i == 4)
                {
                    foreach (var key in regions)
                    {
                        LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                    }
                }
                else if (i == 5)
                {
                    foreach (var key in regions)
                    {
                        ApplyMapKeyLighting(key, burstcol, false);
                    }
                }
                else if (i == 6)
                {
                    foreach (var key in regions)
                    {
                        LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                    }
                }
                else if (i == 7)
                {
                    foreach (var key in regions)
                    {
                        ApplyMapKeyLighting(key, burstcol, false);
                    }
                }
                else if (i == 8)
                {
                    foreach (var key in regions)
                    {
                        LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                    }
                }

                if (i < 8)
                {
                    Thread.Sleep(speed);
                }
            }
        }
        public Task Ripple1(Color burstcol, int speed, Color baseColor)
        {
            return(new Task(() =>
            {
                if (!_logitechDeviceKeyboard)
                {
                    return;
                }

                for (var i = 0; i <= 9; i++)
                {
                    if (i == 0)
                    {
                        //Setup

                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            try
                            {
                                KeyboardNames keyName;
                                if (Enum.TryParse(key, out keyName))
                                {
                                    LogitechSdkWrapper.LogiLedSaveLightingForKey(keyName);
                                }
                            }
                            catch (Exception ex)
                            {
                                Write.WriteConsole(ConsoleTypes.Error, "(" + key + "): " + ex.Message);
                            }
                        }
                    }
                    else if (i == 1)
                    {
                        //Step 0
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep0, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 2)
                    {
                        //Step 1
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep1, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 3)
                    {
                        //Step 2
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep2, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 4)
                    {
                        //Step 3
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep3, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 5)
                    {
                        //Step 4
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep4, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 6)
                    {
                        //Step 5
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep5, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 7)
                    {
                        //Step 6
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep6, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 8)
                    {
                        //Step 7
                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            var pos = Array.IndexOf(DeviceEffects.PulseOutStep7, key);
                            if (pos > -1)
                            {
                                ApplyMapKeyLighting(key, burstcol, false);
                            }
                            else
                            {
                                LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                            }
                        }
                    }
                    else if (i == 9)
                    {
                        //Spin down

                        foreach (var key in DeviceEffects.GlobalKeys)
                        {
                            LogitechSdkWrapper.LogiLedRestoreLightingForKey(ToKeyboardNames(key));
                        }

                        ApplyMapKeyLighting("D1", baseColor, false);
                        ApplyMapKeyLighting("D2", baseColor, false);
                        ApplyMapKeyLighting("D3", baseColor, false);
                        ApplyMapKeyLighting("D4", baseColor, false);
                        ApplyMapKeyLighting("D5", baseColor, false);
                        ApplyMapKeyLighting("D6", baseColor, false);
                        ApplyMapKeyLighting("D7", baseColor, false);
                        ApplyMapKeyLighting("D8", baseColor, false);
                        ApplyMapKeyLighting("D9", baseColor, false);
                        ApplyMapKeyLighting("D0", baseColor, false);
                        ApplyMapKeyLighting("OemMinus", baseColor, false);
                        ApplyMapKeyLighting("OemEquals", baseColor, false);
                    }

                    if (i < 9)
                    {
                        Thread.Sleep(speed);
                    }
                }
            }));
        }