WootingKb / wooting-rgb-sdk

Customize colors on Wooting Keyboard #WootDev
Mozilla Public License 2.0
62 stars 15 forks source link

wooting_rgb_kbd_connected function always returns 0(false) #52

Closed holybaechu closed 1 year ago

holybaechu commented 1 year ago

Code:

int main()
{
    while (true) {
        std::cout << wooting_rgb_kbd_connected();
        // check for keyboard is connected
        if (!wooting_rgb_kbd_connected()) {
            std::cout << "Waiting for keyboard connect...";
            while (!wooting_rgb_kbd_connected()) { Sleep(1); }; // wait for keyboard connect
        }
        std::cout << "Wooting keyboard connected!";
        POINT p;
        if (GetCursorPos(&p))
        {
            RGBTRIPLE result = getPixel(p.x, p.y);

            int r = result.rgbtRed;
            int g = result.rgbtGreen;
            int b = result.rgbtBlue;

            std::cout << r << ", " << g <<  ", " << b << endl;
        }
    }

    return 0;
}
BigBrainAFK commented 1 year ago

If you use a 60HE ARM you will need to build the RGB SDK from source at the moment as no build is published with 60HE ARM support.