Path: news.mitre.org!blanket.mitre.org!nntprelay.mathworks.com!newsfeed.internetmci.com!4.1.16.34!cpk-news-hub1.bbnplanet.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!news.Stanford.EDU!Radon.Stanford.EDU!Xenon.Stanford.EDU!sihde From: sihde@Xenon.Stanford.EDU (Steve Ihde) Newsgroups: comp.os.ms-windows.programmer.nt.kernel-mode,comp.os.ms-windows.programmer.win32 Subject: Re: Talk to the keyboard Followup-To: comp.os.ms-windows.programmer.nt.kernel-mode Date: 21 Jan 98 23:06:26 GMT Organization: Stanford University: Computer Science Department, CA USA Lines: 27 Message-ID: References: <885355118.1976107025@dejanews.com> NNTP-Posting-Host: xenon.stanford.edu X-Newsreader: NN version 6.5.0 #4 (NOV) Xref: news.mitre.org comp.os.ms-windows.programmer.nt.kernel-mode:6619 comp.os.ms-windows.programmer.win32:96967 Hi Jonathan, I was able to acheive a very similar functionality, that is, two-way communication with the mouse through the PS/2 keyboard/mouse controller. Yes, you do have to write your own driver (though possibly only a layered driver and not a replacement). Look at the ddk source in ddk\src\input\i8042prt\i8042dep.c, e.g., I8xGetBytePolled() et al. These routines are in the i8042prt driver. You can't call them, though, because they're not exported. You could, however, just incorporate those routines into your code. The rest of the source is there, too: i8042prt handles interrupts and common code for the PS/2 keyboard and mouse drivers. Kbdclass is the keyboard driver. Kbdus and kbdgr are sample keyboard layouts for US and German. Think about whether you need to replace the keyboard driver or just filter it and send some extra bytes out to it sometimes. Think about whether these communications will mess up the keyboard driver's internal state (the source is in the ddk in kbdclass and i8042prt). Think about what to do if the mouse is moving at the same time.... I'd suggest following up only to .nt.kernel-mode, as this is getting out of the realm of Win32.... -Steve Ihde