Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!zephyr!tektronix!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.sys.ibm.pc Subject: Re: AT keyboards, ports, and other things Message-ID: <5404@tekgvs.LABS.TEK.COM> Date: 21 Jun 89 14:38:18 GMT References: <10146@polya.Stanford.EDU> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 40 In article <10146@polya.Stanford.EDU> stanton@Polya.Stanford.EDU (Scott Stanton) writes: >Is it possible for an extended (101 key) keyboard to do chording on an >AT (clone)? i.e. Can I detect if more than one key is being pressed >at the same time? I have no qualms about going straight to the >hardware interrupts on this one, assuming I can find any info on >those. Yes you can, and you don't need to take over the hardware interrupt (!). I had just such an application. I chained into interrupt 15H (system intercept) handling only the cases when AH=4FH (keycode function). In this case, AL has the key scan code (which has make/break encoded in the msb). If you return with carry clear, then the key is ignored. I would "snarf" the keycodes I was interested in into my own ring buffer, which my program would then empty. If you return with carry set, then the value in AL is used as the key code -- I made use of this in my oft-posted TSR KBDR.COM which makes the caps lock key behave as an additional control key. >Which brings me to my next question: Could someone provide me >with a description of how INT 9H works? You need to find a copy of the Technical reference manual, which unfortuately is now out of print. It also lists all the keycodes. >Is it triggered by both >key press and key release? Normally. It turns out the keyboard can be programmed to run in three different modes! >How do I query the keyboard to >determine which key(s) are currently being held down? You can't. I maintained a bit-per-key table to keep track of depressions. To make matters worse, the "typamatic" action causes multiple depress codes (without release codes) to be sent! My app required no repeating keys, so if I got a depress code when the table indicated already depressed, I ignored the code. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply