Here some come code in linux for example:
void set_leds(int val)
{
int fd = open ("/dev/console", O_WRONLY);
// argument (Bit 0 - Scroll Lock, Bit 1 - Num Lock, Bit 2 - Caps lock)
ioctl (fd, KDSETLED, val);
close(fd);
}
void set_leds_sequence(unsigned char * cmdSeq, int len)
{
int i;
for (i = 0; i < len; ++i)
{
set_leds( cmdSeq[i] );
}
}
void activate(void)
{
unsigned char seq_activate[3] = {3, 5, 4};
set_leds_sequence(seq_activate, 3);
}
How can i do something like that on Windows (C++\C)? I have a feeling that the keybd_event does not approach me. Is there a simple method to turn on/off Caps Lock, Scroll Lock and Num Lock LEDS on Windows?
keybd_eventdocs: Note This function has been superseded. Use SendInput instead. And indeed,SetKeyboardStateexplains thatSendInputis the proper way to do it. - chris