NOVICE question: How to know when a key is pressed

Scott Amspoker scott at bbxsda.UUCP
Fri Apr 12 07:22:33 AEST 1991


In article <1991Apr11.155200.12819 at ericsson.se> etxpihl at tore.ericsson.se (DEE Tomas Pihl) writes:
>I want to know how you can scan if a specific key has been pressed.
>Just as this program I'm using know know that i press eg. ESC.
>I don't want the pressed key to be echoed out to the screen as it is
>with getchar().

What you want is to be able to read individual key strokes without
echo.  There is no standard way to do it.  On unix/xenix systems
check the ioctl() calls in your manual.  On MSDOS you can perform
raw console I/O (again, check the manual).  Another newsgroup can
probably provide a better answer.

-- 
Scott Amspoker                       | Touch the peripheral convex of every
Basis International, Albuquerque, NM | kind, then various kinds of blaming
(505) 345-5232                       | sound can be sent forth.
unmvax.cs.unm.edu!bbx!bbxsda!scott   |    - Instructions for a little box that
                                     |      blurts out obscenities.



More information about the Comp.lang.c mailing list