www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/26/03:41:13

From: Jorrit DOT Tyberghein AT uz DOT kuleuven DOT ac DOT be (Jorrit Tyberghein)
Subject: Problem with keyboard handling
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Date: Mon, 26 Jun 1995 08:56:09 +0200 (MET DST)

Hi,

One week ago I downloaded DJGPP 1.12, maintenance release 4. It really
is a magnificent compiler. Now I have ported one of my applications from
Borland C to DJGPP. It mainly works but I have a problem with the handling
of the keyboard. I need to check if a key is pressed without waiting for
the key. I used to do this with the following routine:

	union REGS r;
	r.h.ah = 0x11;
	int86 (0x16, &r, &r);
	return !(reg.x.flags & 0x40);

This worked perfectly in Borland C and this also seems to work with DJGPP.
However with some keys (Alt-arrows, Ctr-Up, Ctr-Down, Ctr-Del, Alt-Del,
F11, F12, ...) the reaction is not always perfect. The routine only seems
to catch about 75% of these keypresses and just ignores the other 25%.
For all other keys the routine works perfect.

I then tried to use the following routine instead:

	return bioskey (1);

But this routine ignores all the keys that are slow with the int86 routine.
So there must be something special with those keys since this function seems
to ignore them and the int86 method has some problems with them.

If I use the following routine:

	return kbhit ();

I get the same result as with bioskey (1).

Using getxkey () I can see that the keys are correctly registered. So
getxkey () knows how to handle those keys.

What do I do wrong? How can I correctly test if one of those keys is hit?

Some information about the systems I tried this on (with the same result):
	- Compaq Concerto 486, MS-DOS 6.00
	- Toshiba 1950, MS-DOS 6.00
	- Toshiba 2000SXe, MS-DOS 5.00 + 4DOS

Greetings and many thanks in advance,

==============================================================================
Jorrit DOT Tyberghein AT uz DOT kuleuven DOT ac DOT be, University Hospitals KU Leuven BELGIUM

And then you bit onto them, and learned once again that Cut-me-own-Throat
Dibbler could find a use for bits of an animal that the animal didn't know
it had got. Dibbler had worked out that with enough fried onions and
mustard people would eat *anything*.
        -- A fact McDonalds knows about as well
           (Terry Pratchett, Moving Pictures)
==============================================================================

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019