www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/25/14:39:02

Date: Wed, 25 Dec 1996 20:16:27 +0100 (MET)
Message-Id: <1.5.4.16.19961225201653.222fac74@nethosting.com>
Mime-Version: 1.0
To: djgpp AT delorie DOT com
From: Andreas Vernersson <hubble AT nethosting DOT com>
Subject: Re: Reading the keyboard
Cc: T DOT Harte AT btinternet DOT com

At 20:00 1996-12-24 GMT, Thomas Harte <T DOT Harte AT btinternet DOT com> wrote:
>	Who knows the best way to read a keyboard on an IBM PC, under DJGPP for
>use in a game situation - that is so that multiple key presses can be
>detected?

Probably by hooking interrupt $9, and reading port $60 which if the key is
released the 8th bit of the byte is set, and othervise not. Then and having
a list of flags that indicates which keys are down. And the interrupt=
 shouldn't
call the old interrupt which are a waste, because the new can the essential
stuff like:
 - Reading port $61, OR:ing (binary) by $80, and writing this value to port=
 $61
 - AND:ing (binary) that value by $7F and writing this value to port $61
 - Reading port $20, and writing this value to port $20

(that how i made my keyboardhandler)

/andreas vernersson - ume=E5,sweden - hubb AT freenet DOT hut DOT fi - IRC:hubble=20

- Raw text -


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