/// <summary> /// Sets the color on a specific row and column on the keyboard grid. /// </summary> /// <param name="row">Row to set, between 0 and <see cref="Constants.MaxRows" /> (exclusive upper-bound).</param> /// <param name="column">Column to set, between 0 and <see cref="Constants.MaxColumns" /> (exclusive upper-bound).</param> /// <param name="color">Color to set.</param> /// <param name="clear">Whether or not to clear the existing colors before setting this one.</param> /// <exception cref="ArgumentException">Thrown if the row or column parameters are outside the valid ranges.</exception> public void SetPosition(int row, int column, Color color, bool clear = false) { if (clear) { _grid.Clear(); } _grid[row, column] = color; SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.CustomKey, _grid)); }
/// <summary> /// Sets the color of a specific key on the keyboard. /// </summary> /// <param name="key">Key to modify.</param> /// <param name="color">Color to set.</param> /// <param name="clear">If true, the keyboard will first be cleared before setting the key.</param> public void SetKey(Key key, Color color, bool clear = false) { if (clear) { _grid.Clear(); } _grid[key] = color; SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.CustomKey, _grid)); }
/// <summary> /// Sets the color on a specific row and column on the keyboard grid. /// </summary> /// <param name="row">Row to set, between 0 and <see cref="Constants.MaxRows" /> (exclusive upper-bound).</param> /// <param name="column">Column to set, between 0 and <see cref="Constants.MaxColumns" /> (exclusive upper-bound).</param> /// <param name="color">Color to set.</param> /// <param name="clear">Whether or not to clear the existing colors before setting this one.</param> /// <exception cref="ArgumentException">Thrown if the row or column parameters are outside the valid ranges.</exception> public void SetPosition(Size row, Size column, Color color, bool clear = false) { if (clear) { _grid.Clear(); } _grid[(int)row, (int)column] = color; SetGuid(NativeWrapper.CreateKeyboardEffect(_grid)); }
/// <summary> /// Sets a wave effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void SetWave(Wave effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.Wave, effect)); }
/// <summary> /// Sets a static color on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void SetStatic(Static effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.Static, effect)); }
/// <summary> /// Sets a reactive effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void SetReactive(Reactive effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.Reactive, effect)); }
/// <summary> /// Sets an effect without any parameters. /// Currently, this only works for the <see cref="Effect.None" /> and <see cref="Effect.SpectrumCycling" /> effects. /// </summary> /// <param name="effect">Effect options.</param> public void SetEffect(Effect effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(effect, IntPtr.Zero)); }
/// <summary> /// Sets a custom grid effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> /// <remarks> /// This will overwrite the current internal <see cref="Custom" /> /// struct in the <see cref="Keyboard" /> class. /// </remarks> public void SetCustom(Custom effect) { _grid = effect; SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.CustomKey, _grid)); }
/// <summary> /// Sets the color of all keys on the keyboard. /// </summary> /// <param name="color">Color to set.</param> public override void SetAll(Color color) { _grid.Set(color); SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.CustomKey, _grid)); }
/// <summary> /// Sets a breathing effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void SetBreathing(Breathing effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.Breathing, effect)); }
/// <summary> /// Sets a wave effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void Set(Wave effect) { Set(NativeWrapper.CreateKeyboardEffect(effect)); }
/// <summary> /// Sets the color of all keys on the keyboard. /// </summary> /// <param name="color">Color to set.</param> public override void Set(Color color) { Set(NativeWrapper.CreateKeyboardEffect(new Static { Color = color })); }
/// <summary> /// Sets a breathing effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void Set(Breathing effect) { Set(NativeWrapper.CreateKeyboardEffect(effect)); }
/// <summary> /// Sets a starlight effect on the keyboard. /// </summary> /// <param name="effect">Effect options.</param> public void SetStarlight(Starlight effect) { SetGuid(NativeWrapper.CreateKeyboardEffect(Effect.Starlight, effect)); }