Date: Wed, 1 Aug 2001 11:55:41 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Gwen cc: djgpp AT delorie DOT com Subject: Re: question about getkey() , time() and how to pick a char from the screen In-Reply-To: <01c11a27$b0e92280$108784d5@feta> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 1 Aug 2001, Gwen wrote: > I tried with some code : > > unsigned key; > while (true) { > key=bioskey(0); > if (key!=0) { > putch(key); > } > } > > I press 'p', it does nothing I cannot reproduce this: your program works for me (after I fill in some missing stuff to make it compile). > idem for command=10 and command=11, Note that that's 10 and 11 in hex, not in decimal. > With command=1, it loops forever displaying a lot of 'p', that's normal, > but if I press an other key, it will keep displaying the first key pressed, > why ? Because it doesn't remove the key from the keyboard queue, as documented in the library reference. > Is there some predefined constant (like keys.h) to use with bioskey() ? bioskey is a direct interface to the BIOS functions, so it returns the scan code and the ASCII character as the BIOS returns them. You can use keys.h for keys without Ctrl/Alt/Shift modifiers.