Mail Archives: djgpp/2001/08/01/08:05:58
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.
- Raw text -