protected override bool OnKeyPress(CorsairLedId ledId, bool pressed) { if (ledId == CorsairLedId.C || ledId == CorsairLedId.Space) { SolidColorBrush Brush = new SolidColorBrush(FromArgb(0xFFFF0000)); if (!pressed) { Brush.AddEffect(new FlashEffect() { Attack = 0, Sustain = 0, Release = 1, Repetitions = 1, }); } else { //Brush.AddEffect(new FlashEffect() //{ // Attack = 0.01f, // Sustain = 0.02f, // Release = 0.01f, // Repetitions = 0, // Interval = 0.02f, //}); } ShootingEffectGroup.Brush = Brush; } return(false); }
public static bool FlashLighting(LedSdk sdk, int red, int green, int blue, int duration, int interval) { bool set = false; CheckRgbValues(red, green, blue); if (sdk == LedSdk.Logitech) { set = LogitechGSDK.LogiLedFlashLighting(red, green, blue, duration, interval); } else if (sdk == LedSdk.Corsair) { CueSDK.HeadsetSDK.Brush.Effects.Clear(); byte[] rgb = ConvertPercentagesToRgbValues(red, green, blue); SolidColorBrush b = new SolidColorBrush(new CorsairColor(rgb[0], rgb[1], rgb[2])); b.AddEffect(new FlashEffect() { Attack = 0f, Sustain = (float)interval / 2f, Release = 0f, Interval = (float)interval / 2f, Repetitions = duration / interval }); CueSDK.HeadsetSDK.Brush = b; b.UpdateEffects(); set = true; } if (set) { Debug.WriteLine($"Lights flashing {red}, {green}, {blue} for {sdk}!"); } return(set); }
public override bool OnKeypress(CorsairLedId ledId, bool pressed) { if (pressed) { IBrush Brush; switch (ledId) { case CorsairLedId.ScanNextTrack: case CorsairLedId.ScanPreviousTrack: Brush = new LinearGradientBrush(new LinearGradient(new GradientStop[] { Profile.GradStop(0x00FFFFFF, 0f), Profile.GradStop(0xFFFFFFFF, -0.5f), Profile.GradStop(0x00FFFFFF, -1.0f), })); Brush.AddEffect(new MoveLinearGradientEffect(2, ledId == CorsairLedId.ScanNextTrack)); MediaGroup2.Brush = Brush; return(true); case CorsairLedId.PlayPause: case CorsairLedId.Stop: Brush = new SolidColorBrush(ledId == CorsairLedId.PlayPause ? Color.Green : Color.Red); FlashEffect Effect = new FlashEffect() { Attack = 0, Sustain = 0.5f, Release = 0.5f, Repetitions = 1 }; Brush.AddEffect(Effect); (ledId == CorsairLedId.PlayPause ? MediaGroup : MediaGroup3).Brush = Brush; return(true); } } return(false); }
public void fadeFromBlack() { SolidColorBrush brush = new SolidColorBrush(Color.Black); brush.AddEffect(new FlashEffect() { Attack = 0, Decay = 0.5f, Sustain = 0, Repetitions = 1 }); new ListLedGroup(Keyboard, Keyboard.Leds).Brush = brush; }
public override bool OnKeypress(CorsairLedId ledId, bool pressed) { if (AppliedKeys.Contains(CueSDK.KeyboardSDK[ledId])) { SolidColorBrush brush = new SolidColorBrush(FlashColor); if (!pressed) { brush.AddEffect(new FlashEffect() { Attack = this.Attack, Decay = this.Decay, Sustain = this.Sustain, Release = this.Release, AttackValue = this.AttackValue, SustainValue = this.SustainValue, Repetitions = 1 }); } Profile.GetSingleLedGroup(ledId).Brush = brush; } return(false); }