From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot) Newsgroups: comp.os.msdos.djgpp Subject: Re: Keys Date: 29 Jul 1997 23:36:18 GMT Organization: Oxford University, England Lines: 19 Message-ID: <5rlupi$101@news.ox.ac.uk> References: NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 Merton College, Oxford