This is not a software problem to solve with a library.
The keyboard LEDs are controlled by software — in particular by the keyboard device driver generating commands to be sent to the keyboard microprocessor that turn the LEDs on and off, in response to I/O Control requests.
The hard disc activity lights on your front panel are controlled by hardware. They are connected to the mainboard, and — to cut a long story short — wired up to an output of the PCI-to-ATA bridge chip. (For the ICH10, for example, this output is the SATALED#
output.) Hardware turns this output on and off as commands are sent across the SATA/PATA bus. Those who remember life with SCSI will remember that SCSI hard disc activity didn't affect the "hard disc" LED, since it is driven by the ATA bridge hardware.
It's not really practical — and would require a considerable amount of extra software and hardware — for output on the SATALED#
signal to cause hardware interrupts that are received by software, which then triggers commands by the keyboard device driver. It's a fairly knuckleheaded design. But the converse approach, of having all disc I/O commands generated by the disc device driver make a side trip through the keyboard device driver is almost as bad, albeit that it doesn't require a whole new type of hardware device that receives "The front panel LED is on!" interrupts. It requires two distinct hardware subsystems — disc and keyboard — to be linked, and a fair amount of systems programming. It would also effectively limit all disc I/O to the speed of the keyboard.
This is a hardware problem to solve, very simply, with a longer piece of wire.
If your front panel is hidden away in a drawer or under a table, and you want to see the front panel LEDs, then simply make a detachable front panel of your own and connect it to the mainboard with longer wires. A quick check on eBay reveals that there exist computer component vendors that will sell to you such front panel cables (with the LEDs and switches attached) of varying lengths, up to at least 1 metre.
4I like this idea! Hopefully someone can answer for Windows also? – Iszi – 2011-11-29T18:30:09.680
1You can edit the HDD LED requirement back to your question. The solutions might not blink as fast as normal hdd led, but it works quite nicely on my keyboard. And it's quite useful, because I can't see my hdd leds. – Manwe – 2012-01-20T15:57:03.620