www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/07/05/22:09:40

From: jih-shin ho <u7711501 AT bicmos DOT ee DOT nctu DOT edu DOT tw>
Subject: Re: how to tell which key is down
To: hegt AT iaci DOT kun DOT nl
Date: Tue, 6 Jul 93 9:35:28 EAT
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu (djgpp)

> 
> 
> Hello all,
> 
> I would like to know how I can tell which key is currently pressed. I
> know I can use getkey() to see which key has been pressed, but that is
> not good enough.
> 
> Can I re-program the keyboard controller in such a way that I can simply
> read some port, or is there another approach?
> 
> Example code would be nice ...
> 
> 
> Thanks,
> Rob Hegt
> 

You should write an interrupt subroutine for INT 9.
When a key is pressed, the keyboard will send the scan code x.
If it is depressed, the keyboard will send 0x80+x.

- Raw text -


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