Mail Archives: djgpp/1997/11/12/07:13:37
On Wed, 12 Nov 1997, Michael Mauch wrote:
> DJGPP's kbhit() looks just at the keyboard buffer variables in DOS
> memory - that's a fast method, but it doesn't allow multitaskers to
> recognize that a program polls the keyboard most of its time.
IMHO, a better way is to use the `select' library function. It is
portable to Linux (and Unix in general) and calls `__dpmi_yield'
internally while it waits. It also has a time-out option. Check it
out in the library reference.
> > And a last note: Have you ever tried, that the __dpmi_yield()
> > has any effect? When I remember correct, I tried it already several
> > times and couldn't see any effect.
>
> Maybe you can check again with the following little test program(s).
AFAIK, the effect of `__dpmi_yield' depends on the DPMI host and on
the details of how the scheduler works and which parameters did you
set e.g. in the Property Sheet of the DOS box on Windows 95. Some
DPMI 0.9 hosts don't do anything with that call.
- Raw text -