www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/19/11:37:05

Date: Wed, 19 Jun 1996 18:25:29 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Peter Johnson <locke AT mcs DOT net>
Cc: djgpp AT delorie DOT com
Subject: Re: Trapping the PAUSE key
In-Reply-To: <31c5b238.7657104@news.mcs.net>
Message-Id: <Pine.SUN.3.91.960619181627.19221A-100000@is>
Mime-Version: 1.0

On Mon, 17 Jun 1996, Peter Johnson wrote:

> In many games, e.g. Doom, Terminal Velocity, etc, the "pause" key does
> not pause the computer, but rather pauses the game.  Obviously, the
> pause key must have been trapped in some manner.  Any ideas on doing
> this in DJGPP?  Either disabling the pause key entirely or somehow
> having a function called when it is hit would be very valuable.

PAUSE doesn't have its own scan code, but emulates a simultaneous press of
two keys: Ctrl+NumLock.  However, it uses the E1h precode byte to allow
programs to distinguish between PAUSE keypress and actual Ctrl+NumLock, in
a manner similar to the way editing keypad keys (like PageDown) are
distinguished from the keys on the numeric keypad (like the 3/PgDn key). 
The bottom line is that when you press and release Ctrl+NumLock, the
keyboard generates the sequence 1Dh 45h 9Dh C5h, while when you press
PAUSE the generated sequence is E1h 1Dh 45h E1h 9Dh C5h.  (Note that this
latter sequence of scancodes includes *both* make and break codes, even if
you press PAUSE and keep it pressed.  This is different from Ctrl+NumLock
which generates make sequence 1Dh 45h when you press them and break
sequence 9Dh C5h when you release them.)

- Raw text -


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