In the quest for better ways to flash the keyboard LEDs, I needed a way to write directly to the keyboard hardware. By writing into the right "key register" I could enable the non-standard message LED on my multifunction keyboard.
Warning: this technique applies to Win2k/XP only and it involves non-standard driver techniques that may lock up your PC. They don't lockup mine, but you're warned.
Writing directly to the keyboard isn't normally possible with Win2k/XP.
Julien created the new keybd plugin, but there are some limitations and it doesn't work with the "key register" I needed.
The extended key registers of my HP-brand multimedia keyboard are documented in http://www.win.tue.nl/~aeb/linux/kbd/scancodes-5.html#ss5.25. This is a very good resource that documents many other different keyboard brands.
Googling around, I found a C program for Linux that can flash the HP message LED. It's a Linux only solution since it writes to a device port that isn't supported in Win2k, or so I thought at the beginning, until I found better. The Linux C program can be found here http://et10.org/hpbiff
In porting this code to Win2k I needed some way to translate the Linux outb() function. One opensource solution that involves installing the cygwin package is Marcel Telka's ioperm, which can be found here http://sourceforge.net/projects/openwince. However, I didn't test it because I didn't want to install cygwin.
Googling some more, I found a Windows NT I/O port driver at http://www.beyondlogic.org/porttalk/porttalk.htm. This is a simple solution and the one I ended up using, since it comes with a source code equivalent of the Linux outb() function.
The final recipe is summarized here. You'll need a C compiler (I use MinGW), a properly installed porttalk driver package, and hpbiff.c.
Edit hpbiff.c version 1.0 and change all calls to ioperm() into calls to OpenPortTalk(). Also add a call to ClosePortTalk() anywhere where there are statements that terminate the program, such as exit() or return. Finally change the calls to
usleep(300); outb(0xEB, 0x60);
into calls to
outportb(0x60, 0xEB);
and likewise for calls to outb(0xEC, 0x60).
Compile hpbiff.c and copy hpbiff.exe into a folder in your %path% along with a copy of porttalk.sys into the same folder.
You can run hpbiff.exe directly from the command line, or call it from the following PowerPro script, which behaves very similarly to FlashLED.powerpro presented elsewhere.
|