How to turn on the backlight of the keyboard cover without actually turning on the lock cover?

I am writing a program that uses cache lock as a toggle switch. It would be nice to set the LED of the key to show that my program is on or off, for example, a lock key.

I know that I can simply SendInput('Capslock');or something else to enable and disable the lock function. But my application is a text input program, and I don’t want to deal with the translation of all-caps keys that included it, would give me their lower / upper case letters. I could go this route in the end, but not for this version.

However, I would be interested to simply turn on the LED indicator WITHOUT , actually turning on the cover lock. Is there any way to do this?

Thank.

+2
source share
3 answers

You can find the code for changing indicators on the keyboard from C # to Faking num lock, caps lock and scroll locks

+3
source

I am sure that you cannot switch the LED without switching the actual Caps lock, unless you are writing a keyboard driver. (I do not recommend this!)

+2
source

Miranda IM " Keyboard Notify Ext.", C . . keyboard.c . , #.

:

mir_snprintf(aux1, sizeof(aux1), "Kbd%d", i);
mir_snprintf(aux2, sizeof(aux2), "\\Device\\KeyboardClass%d", i);
DefineDosDevice(DDD_RAW_TARGET_PATH, aux1, aux2);

mir_snprintf(aux1, sizeof(aux1), "\\\\.\\Kbd%d", i);
hKbdDev[i] = CreateFile(aux1, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);

...

result |= DeviceIoControl(hKbdDev[i], IOCTL_KEYBOARD_SET_INDICATORS, &InputBuffer, DataLength, NULL, 0, &ReturnedLength, NULL);
+2

All Articles