home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 337_01 / l_getkey.c < prev    next >
C/C++ Source or Header  |  1991-01-14  |  693b  |  29 lines

  1. /* Copyright (c) James L. Pinson 1990,1991  */
  2.  
  3. /**********************   L_GETKEY.C  ***************************/
  4.  
  5. #include "mydef.h"
  6.  
  7.  
  8. /*****************************************************************
  9.  
  10.  Usage: void get_key(char *ch, char *ext);
  11.  
  12.  
  13.   char *ch=  character to read from keyboard.
  14.  
  15.   char *ext= extended character (if any).
  16.  
  17.   Reads character and extended character from keyboard.
  18.  
  19. *****************************************************************/
  20.  
  21. void get_key(char *ch, char *ext)
  22. {
  23.   *ch=getch();      /* get the character */
  24.  
  25.     if(!*ch){       /* if the character is zero (a special key) */
  26.       *ext=getch(); /* get the extension */
  27.     }
  28. }
  29.