delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/07/25/09:10:16

Date: Mon, 25 Jul 94 08:25:43 EST
From: acmq AT alpha DOT coe DOT ufrj DOT br (Antonio Carlos Moreirao de Queiroz)
To: combee AT cambridge DOT scr DOT slb DOT com
Subject: Re: libgrx and keyboard events
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

Leendert Combee writes:

>   I'm (still) using djgpp version 1.10/libgrx. Now I was wondering, is
>   there something equivalent to MouseGetEvent((M_KEYPRESS | M_POLL),&...) 
>   that doesn't require a mouse to be present. I only want to check for
>   a _possible_ keypress. ...

Use kbhit() to detect that a key was pressed.
If I remember well, you must include gppconio.h and link -lpc to use kbhit().
If you are using a mouse, use something like:
MouseGetEvent((M_POLL | M_EVENT) & (~M_KEYPRESS),&mevent)
or kbhit() will not work.        ^^^^^^^^^^^^^^^
Probably you have to test if a mouse is present using MouseDetect() before
calling mouse functions.

Antonio Carlos M. de Queiroz



- Raw text -


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