You can do this by capturing keybord interrupt.(09h?yes)
I remember I have seen an article solving this problem.Actually,it is not
an easy stuff,but Im not sure I can check it out.:~)
...
Correct; hardware interrupt 9h is the keyboard interrupt, and it's possible to use that to get keyboard states. But if you're compiling for Win32, then by all means use the API like bdiamond suggests--it's tougher to write your own int 9 handler, and what you get is something that works just like GetAsyncKeyState anyway....
I think I have the same problem with you.Im thinking about reading data
from I/O directly,but I havnt done it yet.
Dealing with the keyboard controller directly like that is a couple of orders of magnitude more insane than writing your own handler, trust me.
If you really want to play with hardware, the old, 16-bit DOS edition of theThe Art of Assembly Language Programming has a chapter on the IBM PC keyboard and int 9 handling which I think is quite useful, if you don't mind x86 assembly.
--sg