Mail Archives: djgpp/1997/07/30/06:49:07
Jan Hubicka (hubicka AT ta DOT jcu DOT cz) wrote:
: Hi. I need to know ascii codes of pressed keys. But I also need to be
: informed about ther release. Whats the easiest way to do this?
The easiest way is to use Allegro, which already does the ground work for
you. Technically speaking, you need to intercept the keyboard IRQ,
processing it suitably to discover whether the message is a press or a
release. Then you update an array showing the keys' states, or put a
message in a queue, or something similarly useful. The main program will
read this array or event queue later on.
Allegro's routines provide such an array, indexed by scancode, and
#defines for each key on the keyboard to give the scancodes. You can
extract the keyboard code from Allegro, of course, and use it seperately
from the rest of the library.
--
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford
- Raw text -