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;
}
Code: