Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!cs.utexas.edu!tut.cis.ohio-state.edu!sppy00!wjc From: wjc@sppy00.UUCP (William J. Curry) Newsgroups: comp.sys.ibm.pc Subject: Re:Keyboard Detection Question Message-ID: <584@sppy00.UUCP> Date: 31 Oct 89 19:28:56 GMT Reply-To: wjc@sppy00.UUCP (William J. Curry) Distribution: usa Organization: Online Computer Library Center, Dublin, Ohio. Lines: 48 In article <1989Oct31.054436.20492@ntvax.uucp> jbeard@ntvax.UUCP (Jeff Beardsley) asks >Does anyone out there know how to detect the presence of an enhanced >keyboard (101 keys, F11, F12, etc). I do know how to use it once it's >there, but assuming it to be there will cause most machines without it >to lock up. Simple, take the byte at 0x00400096 and AND it with 0x10. If you get a non-zero value, you have an enhanced keyboard attached to the machine and may use the enhanced functions of int16h. For example, #include #define TRUE 1 #define FALSE 0 int CheckForEnhanced(void) { unsigned char far *p; p = (unsigned char far *) 0x00400096; if (*p & 0x10) /* is it an enhanced keyboard? */ return(TRUE); /* yep, let caller know */ return(FALSE); /* must not be enhanced */ } int main(void) { if (CheckForEnhanced()) printf("Enhanced!\n"); else printf("Not Enhanced!\n"); return(0); } Hope it helps! -Bill -- William Curry UUCP:wjc@sppy00.UUCP or {att|pyramid|killer}!osu-cis!sppy00!wjc Snail: 6565 Frantz Road Dublin, Ohio 43017-0702 614-761-5031 == "Of course the standard disclaimer applies, why wouldn't it?" ==