Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard not updating #253

Closed
Ikeiwa opened this issue Dec 25, 2018 · 1 comment
Closed

Keyboard not updating #253

Ikeiwa opened this issue Dec 25, 2018 · 1 comment

Comments

@Ikeiwa
Copy link

Ikeiwa commented Dec 25, 2018

I just tried Colore by following the Getting started page and I can't get the keyboard to update, it just clear and fade back to my synapse configuration, here is my config:
windows 10 x64
.net 5.5.1
colore 6.0.0-unstable0240
synapse 3.3.1128.112711
chroma sdk 2.22.3
testing on a BlackWidow chroma v2

And here is my code :

using System;
using System.Windows.Forms;
using Colore;
using ColoreColor = Colore.Data.Color;

namespace BeatChroma
{
    public partial class Form1 : Form
    {
        IChroma chroma;

        public Form1()
        {
            InitializeComponent();
            
        }

        private async void testColor_Click(object sender, EventArgs e)
        {
            chroma = await ColoreProvider.CreateNativeAsync();
            await chroma.SetAllAsync(ColoreColor.Red);
        }
    }
}
@Ikeiwa
Copy link
Author

Ikeiwa commented Dec 25, 2018

Nevermind, I found a way to make it work. I just had to initialize it properly using the InitializeAsync function.

using System;
using System.Windows.Forms;
using Colore;
using Colore.Data;
using Colore.Effects.Keyboard;
using ColoreColor = Colore.Data.Color;
using Key = Colore.Effects.Keyboard.Key;

namespace BeatChroma
{
    public partial class Form1 : Form
    {
        IChroma chroma;
        IKeyboard keyboard;

        public Form1()
        {
            InitializeComponent();
            InitChroma();
        }

        private async void InitChroma()
        {
            chroma = await ColoreProvider.CreateNativeAsync();
            await chroma.InitializeAsync(new AppInfo("Beat Chroma","A razer chroma rhythm game.","Ikeiwa","none",Category.Application));
            chroma.Register(Handle);
            keyboard = chroma.Keyboard;
        }

        private async void testColor_Click(object sender, EventArgs e)
        {
            var effect = KeyboardCustom.Create();
            effect[Key.A] = ColoreColor.Red;
            await keyboard.SetCustomAsync(effect);
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant