🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.msdos.programmer
Article #138

Re: How to test for key ALREADY pressed

#138
From: Stephen A. Weatherford
Date: Wed, 08 Apr 1992 22:38
19 lines
1268 bytes
kentiler@matt.ksu.ksu.edu (Kent Iler) writes:
 

>Hello,
>   Is there a way to test to see if a key is already pressed.  Let say I run
>this program from the autoexec, and I want to see if the space bar is pressed.
>If it is I want to do one thing, if not I want to do another.  I don't want to
>wait there for a key to be pressed, just see if it already is.  I have C++ and
>Turbo Pascal to program with.  Thanks.
>						--Kent

Check out kbhit() and ungetch() [I think this last one exists] in your
TC++ manual.

--Stephen
----
Stephen A. Weatherford (weather@csrd.uiuc.edu) "mann, wer haette das gedacht
G.R.A., Center for Supercomputing R&D           dass es einmal soweit kommt
U of Illinois at Urbana-Champaign               wegen 99 luftballons"
Technical Details
Message-ID: <1992Apr8.223837.28390@csrd.uiuc.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp90.csrd.uiuc.edu!weather
References: <rqkdmINNkhe@matt.ksu.ksu.edu>

Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!uwm.edu!ux1.cso.uiuc.edu!csrd.uiuc.edu!sp90.csrd.uiuc.edu!weather
From: weather@sp90.csrd.uiuc.edu (Stephen A. Weatherford)
Subject: Re: How to test for key ALREADY pressed
Message-ID: <1992Apr8.223837.28390@csrd.uiuc.edu>
Sender: news@csrd.uiuc.edu
Organization: UIUC Center for Supercomputing Research and Development
References: <rqkdmINNkhe@matt.ksu.ksu.edu>
Date: Wed, 8 Apr 92 22:38:37 GMT
Lines: 19