Mail Archives: djgpp/2001/07/31/21:15:12
Eli Zaretskii <eliz AT is DOT elta DOT co DOT il> wrote in article
<Pine DOT SUN DOT 3 DOT 91 DOT 1010731114717 DOT 1042K-100000 AT is>...
>
> You could use `bioskey' with 1 as the command.
I'm experiencing some problems with bioskey()
excerpt from a help-file about it :
" COMMAND = 0
Returns the next key pressed. The value returned is a combination
of the key's scan code in the high 8 bits and its ASCII code in
the low 8 bits.
COMMAND = 1
Checks the keyboard, returns zero if no key pressed, else the key.
Does not dequeue the key from the keyboard buffer. The value
returned when a key was pressed is a combination of the key's scan
code in the high 8 bits and its ASCII code in the low 8 bits. "
(and command = 10 is command = 0 for extended 101 keyboard, idem command =
11 is command = 1)
I tried with some code :
unsigned key;
while (true) {
key=bioskey(0);
if (key!=0) {
putch(key);
}
}
I press 'p', it does nothing, idem for command=10 and command=11,
strange...
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 ?
Is there some predefined constant (like keys.h) to use with bioskey() ?
Gwen
- Raw text -