I confess I'm completely new to win32 assembly. I'm turning to this forum because all other more higher-level programming language forums I tried didn't help. I need to _send_ characters to the keyboard, for the purpose of using special features of a multifunction keyboard. The keyboard comes with extra LEDs including a message waiting LED. I know from a x86 linux (!) resource that the LED can be turned on/off by sending it certain scancodes. But I haven't found a way to send those scancodes to the keyboard in win32. Can anyone help me?

Further info:
the keyboard is an HP Vectra/Kayak multimedia keyboard, the scancodes are documented in http://www.win.tue.nl/~aeb/linux/kbd/scancodes-5.html#ss5.25
the linux program that can send scancodes to this keyboard is explained in http://et10.org/hpbiff/
there's also a generic version of this program in http://the.earth.li/pub/XFree86/4.1.0/doc/README.rapidaccess
Posted on 2004-01-13 03:28:44 by sgp
sgp,
I am probably completely wrong about this, but it looks like those programs and hacks you refer to are sending codes directly to the keyboard's port. Most likely with a OUT instruction. Some OSes like DOS permit this, but not Windows. I think you need a Windows driver along with the documentation that supports this activity on that hardware. The keyboard's manufacturer should supply that driver if they intend it to be used for Windows. Somebody say I am wrong, anybody. Ratch
Posted on 2004-01-13 08:03:16 by Ratch
If you need to send data to the keyboard via port I/O, you'll need a driver yes. Or perhaps look at http://www.beyondlogic.org/porttalk/porttalk.htm or google, or the search function of this board :)
Posted on 2004-01-13 08:50:12 by f0dder
Thanks, porttalk looks promising. Where can I find a list of the available ports?
Posted on 2004-01-13 09:46:28 by sgp
Ralph brown's portlist, perhaps? :) - be careful when messing with ports, especially under windows. Google for "keyboard port" or something, or have a look at the linux driver.
Posted on 2004-01-13 09:55:07 by f0dder
Is port 60h and 64h with IRQ0 and IRQ12 for PS2 AT keyboard and mouse
But take care as messing with this ports might stop the keyboard and the PS2 mouse from working

Also it will NOT work with USB mouse/keyboards

The right but hard way is to do a KMD driver, but it might work with allready made drivers/DLL's for simple port access.
Posted on 2004-01-13 10:11:23 by BogdanOntanu
Success at first attempt! I'm amazed, you guys in this forum have quickly succeeded where everyone else failed. Thank you so much. A tribute to your collective knowledge.

To summarize: I used the IoExample/ioexample.c file in the porttalk package to quickly adapt hpbiff.c. Compiled it with MinGW and ran it on Win2K. Porttalk autoinstalled the porttalk.sys driver and bang! the LED was flashing.

I understand you're warning me that this isn't a clean solution, that I should write a KMD driver, but that's beyond my abilities. I'll keep my fingers crossed for now.

Again, big thanks to everyone. This is a great forum.
Posted on 2004-01-13 15:21:29 by sgp
I'd say that for something like this, porttalk is probably cleaner. Or well... it's going to be bigger and whatever, but it gets the job done, you shouldn't have to worry about tricky KMD stuff etc.

Where a KMD would be justifiable is if you had to do high-speed serial (or even worse, parallel) data transfer, bit banging the ports and polling for incoming data would cause quite some overhead to the system compared to setting up an IRQ and stuff.
Posted on 2004-01-13 15:30:41 by f0dder