delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/23/21:57:20

From: SerDevian <scriven AT CS DOT ColoState DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Help: Keyboard interrupt
Date: Thu, 23 Jan 1997 10:27:36 -0700
Organization: XYZZ Software Co.
Lines: 30
Message-ID: <32E79F88.167E@CS.ColoState.edu>
References: <854022514 DOT 613673 AT red DOT parallax DOT co DOT uk>
NNTP-Posting-Host: miro.vis.colostate.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

John Eccleston wrote:
> Could someone please give me some pointers as to what I am doing wrong
> with this interrupt handler for the keyboard.

If it helps, look at the keyboard handler on my page.  You might find
your problem by comparing source.

> How would I get hold of the scancode for the key within the
> function my_handler?

I just use the lower 8 bits of the keypress value sent from the
keyboard.  Values from 0-127 indicate that a key was pressed, and values
from 128-255 mean a key was released.

> Is it OK to write an interrupt handler in C if you lock the code and
> data?  I know the FAQ says to write it in assembler but it mentions nothing
> about _go32_dpmi_lock_ functions.

Yes, you can do that.  You should lock your code and data even if you
use assembly, though.  Lock everything the handler can possibly
touch...  :)

I wouldn't recommend using C to write a handler that needs to be *fast*,
but it should be easily fast enough for a keyboard handler.


-- Yamaha / XYZZ          "May farce the with be you."
mailto:scriven AT CS DOT ColoState DOT edu          
mailto:scriven AT VIS DOT ColoState DOT edu
http://www.vis.colostate.edu/~scriven/

- Raw text -


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