Mail Archives: djgpp/1997/08/31/15:19:24

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Checking and retrieving keypresses in Allegro
Date: Sun, 31 Aug 1997 01:49:15 +0100
Organization: None
Distribution: world
Message-ID: <uu9o$>
References: <5u79gn$m3k$1 AT news DOT interlog DOT com>
MIME-Version: 1.0
Lines: 19
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Gautam N. Lad writes:
>So, now, how can I find out if a key is being pressed, just anywhere.
>Whenever a key is pressed, I want to find out what that key is.

After installing the Allegro keyboard handler, call the readkey()
function, or check the flags in the key[] array. See ex5.c...

>I've looked into Allegro's GUI.C source, in the d_edit_proc section (and just 
>about everywhere else), but I'm confused as to how it retrieves key presses.  
>Does it have anything to do with MSG_CHAR?  

It does, but the MSG_CHAR just comes from higher up in the GUI code (the
do_dialog() routine), which in turn obtains the keypress input by
calling readkey().

Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk -
Beauty is a French phonetic corruption of a short cloth neck ornament.

- Raw text -

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