diff --git a/src/classes/Keyboard.cpp b/src/classes/Keyboard.cpp index 1268fcb..8e9fa05 100644 --- a/src/classes/Keyboard.cpp +++ b/src/classes/Keyboard.cpp @@ -739,12 +739,15 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, break; case NativeEffectGroup::cycle: case NativeEffectGroup::waves: + case NativeEffectGroup::ripple: if (! setGroupKeys( LedKeyboard::KeyGroup::indicators, LedKeyboard::Color({0xff, 0xff, 0xff})) ) return false; if (! commit()) return false; break; + default: + break; } return ( setNativeEffect(effect, LedKeyboard::NativeEffectPart::keys, period, color, storage) && @@ -810,6 +813,19 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, switch (part) { case NativeEffectPart::keys: data[4] = 0x01; + + //Seems to conflict with a star-like effect on G410 and G810 + switch (effect) { + case NativeEffect::ripple: + //Adjust periodicity + data[9]=0x00; + data[10]=period.count() >> 8 & 0xff;; + data[11]=period.count() & 0xff; + data[12]=0x00; + break; + default: + break; + } break; case NativeEffectPart::logo: data[4] = 0x00; @@ -827,6 +843,10 @@ bool LedKeyboard::setNativeEffect(NativeEffect effect, NativeEffectPart part, case NativeEffect::cycle: data[5]=0x02; break; + case NativeEffect::ripple: + case NativeEffect::off: + data[5]=0x00; + break; default: data[5]=0x01; break; diff --git a/src/classes/Keyboard.h b/src/classes/Keyboard.h index 6579835..74505e2 100644 --- a/src/classes/Keyboard.h +++ b/src/classes/Keyboard.h @@ -79,19 +79,23 @@ class LedKeyboard { color }; enum class NativeEffectGroup : uint8_t { - color = 0x01, + off, + color, breathing, cycle, - waves + waves, + ripple }; enum class NativeEffect : uint16_t { + off, color = static_cast(NativeEffectGroup::color) << 8, breathing = static_cast(NativeEffectGroup::breathing) << 8, cycle = static_cast(NativeEffectGroup::cycle) << 8, waves = static_cast(NativeEffectGroup::waves) << 8, hwave, vwave, - cwave + cwave, + ripple = static_cast(NativeEffectGroup::ripple) << 8 }; enum class NativeEffectPart : uint8_t { all = 0xff,