Path: utzoo!yunexus!maccs!cs3b3aj From: cs3b3aj@maccs.McMaster.CA (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: Determining Keyboard Codes Message-ID: <2269@maccs.McMaster.CA> Date: 29 Mar 89 20:21:09 GMT Article-I.D.: maccs.2269 References: <1244@naucse.UUCP> Reply-To: cs3b3aj@maccs.UUCP (Stephen M. Dunn) Organization: McMaster U., Hamilton, Ont., Can. Lines: 25 There are (as far as I know) two ways of finding out what keys have been pressed if you are writing in assembly language or a language which can do software interrupts; if you're trying to modify existing software, you're probably out of luck. Anyway, here goes. One method is to get keystrokes with INT 16h function 0. This returns the ASCII code in AL and the scan code in AH; these scan codes are the same on all PC-compatible keyboards. (Note that this function waits for a key to be pressed; use function 1 to check for key presses). The other method is to replace the machine's keyboard driver with one of your own. This involves intercepting int 9, which the keyboard generates whenever a key is pressed or released. However, this gets kinda messy and will cause problems if you have another program in memory doing the same thing (e.g. Sidekick). If you want more info on this, you can probably find some in the IBM PC Technical Reference Manual (or whatever they call it). Hope this helps. -- ====================================================================== ! Stephen M. Dunn, cs3b3aj@maccs.McMaster.CA ! DISCLAIMER: ! ! I always wanted to be a lumberjack! - M.P. ! I'm only an undergrad ! ======================================================================