示例#1
0
        public void Update()
        {
            Effect newEffect = _api.CreateHeadSetEffect(rawEffect);

            newEffect.Set();
            lastEffect?.Delete();
            lastEffect = newEffect;
        }
示例#2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Running!!");
            NativeRazerApi api = new NativeRazerApi();

            System.Threading.Thread.Sleep(1000);
            ChromaDevice[] allDevices       = GetAllDevices();
            ChromaDevice[] connectedDevices = GetActiveDevices(allDevices, api);
            Console.ForegroundColor = ConsoleColor.Green;
            foreach (ChromaDevice connectedDevice in connectedDevices)
            {
                Console.WriteLine("Device detected: " + connectedDevice.Name);
            }
            Console.ResetColor();
            Console.WriteLine();

            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.WriteLine("Setting keyboard color to yellow");
            api.CreateKeyboardEffect(new RazerChroma.Net.Keyboard.Effects.Static(new NativeWin32.ColorRef(255, 255, 0, 0))).Set();
            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Setting mouse color to red");
            api.CreateMouseEffect(new RazerChroma.Net.Mouse.Effects.Static(RazerChroma.Net.Mouse.Definitions.RzLed.All, new NativeWin32.ColorRef(255, 0, 0, 0))).Set();
            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("Setting headset color to green");
            api.CreateHeadSetEffect(new RazerChroma.Net.HeadSet.Effects.Static(new NativeWin32.ColorRef(0, 255, 0, 0))).Set();
            Console.ResetColor();

            Console.ForegroundColor = ConsoleColor.Blue;
            Console.WriteLine("Setting mousemat color to blue");
            api.CreateMousepadEffect(new RazerChroma.Net.MousePad.Effects.Static(new NativeWin32.ColorRef(0, 0, 255, 0))).Set();
            Console.ResetColor();


            Console.WriteLine("First test, Please check that your devices have the right light color, If you dont have that device it is ok.");
            Console.WriteLine("Done, Click an to Continue...");
            Console.ReadKey();

            KeyboradFrame keyboardFrame = new KeyboradFrame(api);
            MouseFrame    mouseFrame    = new MouseFrame(api);
            MousepadFrame mousepadFrame = new MousepadFrame(api);
            HeadsetFrame  headsetFrame  = new HeadsetFrame(api);

            keyboardFrame.SetKey(0, 1, Color.Red);
            keyboardFrame.SetKey(Definitions.RzKey.F, Color.Green);
            keyboardFrame.SetKeys(1, 0, 2, 1, Color.Yellow);
            mouseFrame.SetKey(RazerChroma.Net.Mouse.Definitions.RzLed2.Scrollwheel, Color.Purple);
            mousepadFrame.SetKeys(0, 5, Color.Green);
            headsetFrame.Set(Color.Red);

            headsetFrame.Update();
            mousepadFrame.Update();
            mouseFrame.Update();
            keyboardFrame.Update();
            Console.WriteLine("Done, Click an to Continue...");


            Console.ReadKey();
        }