public override void Shutdown() { if (!isInitialized) { return; } RGBControl.Reset(); isInitialized = false; }
static void TestRGB() { Console.WriteLine("Wooting Rgb Control testing!"); Console.WriteLine($"wooting_rgb_kbd_connected: {RGBControl.IsConnected()}"); //RGBControl.wooting_rgb_direct_set_key(0, 0, 255, 0, 0); //Console.WriteLine("Turning on auto-update!"); //RGBControl.wooting_rgb_array_auto_update(true); Console.WriteLine("Set disconnected cb"); RGBControl.SetDisconnectedCallback((DisconnectedCallback)dc_cb); Console.WriteLine("Setting some keys directly!"); Console.WriteLine($"Setting ESC green: {RGBControl.SetKey(WootingKey.Keys.Esc, 0, 255, 0)}"); RGBControl.UpdateKeyboard(); Console.WriteLine("Setting Enter Red"); RGBControl.SetKey(WootingKey.Keys.Enter, 255, 0, 0, true); Console.WriteLine("Setting G blue"); RGBControl.SetKey(WootingKey.Keys.G, 0, 0, 255, true); Console.WriteLine("Setting Mode/Scroll Lock green"); RGBControl.SetKey(WootingKey.Keys.Mode_ScrollLock, 0, 255, 0, true); Thread.Sleep(5000); Console.WriteLine("Setting the keyboard blank!"); KeyColour[,] keys = new KeyColour[RGBControl.MaxRGBRows, RGBControl.MaxRGBCols]; for (byte i = 0; i < RGBControl.MaxRGBCols; i++) { for (byte j = 0; j < RGBControl.MaxRGBRows; j++) { keys[j, i] = new KeyColour(0, 0, 0); } } RGBControl.SetFull(keys); RGBControl.UpdateKeyboard(); Thread.Sleep(1000); //RGBControl.woo(true); for (byte i = 0; i < RGBControl.MaxRGBCols; i++) { for (byte j = 0; j < RGBControl.MaxRGBRows; j++) { Console.WriteLine($"Setting the key, ROW:{j}, COL:{i}"); keys[j, i] = new KeyColour(255, 255, 0); //RGBControl.SetKey(j, i, 255, 0, 0, true); //RGBControl.SetFull(keys); //RGBControl.UpdateKeyboard(); RGBControl.SetFull(keys); RGBControl.UpdateKeyboard(); Thread.Sleep(100); } //Thread.Sleep(1000); } //Console.WriteLine($"wooting_rgb_kbd_connected: {RGBControl.wooting_rgb_kbd_connected()}"); Console.ReadKey(); RGBControl.Reset(); Console.ReadKey(); }
public void Shutdown() { lock (action_lock) { if (isInitialized) { RGBControl.Reset(); isInitialized = false; } } }