From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Hooking the keyboard interrupt? Date: Thu, 4 Jun 1998 20:24:13 +0100 Organization: None Message-ID: References: <19980603235734 DOT AAD6210 AT ppp104 DOT cartsys DOT com> NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 23 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Nate Eldredge writes: >>Is there also a way to hook the keyboard in Allegro? > >It has a built in keyboard hooking system, see the "Keyboard" section. If >you want to write your own handler, see the functions `install_keyboard_hooks'. The install_keyboard_hooks() function is actually a bit different from this: it is intended for people who want to use BIOS keyboard input or maybe write their own handler, but still be able to read keyboard events using the Allegro keypressed() and readkey() functions. This is mostly useful if someone is trying to mix the Allegro GUI functions (that call readkey()) with some other keyboard input module. If you want to be notified of each keypress, you should use the Allegro install_keyboard() function and then set the keyboard_callback() function pointer to some handler routine of your own. I don't really recommend doing this, though: it is usually much better to use the readkey() function or key[] array to access the input. -- Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/ "Miracles are nothing if you've got the wrong intentions" - Mike Keneally