Date: Wed, 2 Dec 1998 10:47:39 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: djgpp AT delorie DOT com Subject: Re: detecting multiple keypresses In-Reply-To: <36646BFF.77F3@gecm.nospam.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com On Tue, 1 Dec 1998, Edward Hill wrote: > I have spent a while looking at > getkey() and _bios_keybrd() and a few more > but I can't seem to find anything to use > to just detect if a particular key is pressed. > > so say if(keyboard_keypressed('a')printf("a\n"); > if(keyboard_keypressed('b')printf("b\n"); > and the a and b buttons are both held down > a and b will be printed out. There is no library function that does this. Moreover, no BIOS service can possibly do this for you, since the BIOS can only process a single keypress at a time (if you press two keys, the BIOS only returns the first one and ignores the second). AFAIK, the only way to have this functionality is to install a hardware interrupt handler for Int 9. Allegro might be a good place to start, since it already includes functions to hook the keyboard interrupt.