home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / C / DLLIB.ZIP / GETKEY.DOC < prev    next >
Encoding:
Text File  |  1986-09-25  |  1.3 KB  |  39 lines

  1.  
  2.  
  3.        NAME
  4.                getkey -- extended keyboard fetch
  5.  
  6.        SYNOPSIS
  7.                #include "keys.h"
  8.                r = getkey();
  9.                int r;          returns keyboard value
  10.  
  11.  
  12.        DESCRIPTION
  13.        This function eases the reading of all keys, whether normal
  14.        or function keys.  The getch() function is used to return a keyboard
  15.        value.  If the first value received is 0, then a second value
  16.        is fetched and 256 (0x100) is added to flag the return value
  17.        as an extended function key.  The calling program should check
  18.        for a return value greater than 256.  If true, subtract 256 and
  19.        consider the result as a function key.  Most function keys
  20.        are defined in tools.h, and others may be user added.
  21.  
  22.        EXAMPLE
  23.              This example tests for function key 3 (FK3)
  24.  
  25.              #include "tools.h"
  26.              int r;
  27.  
  28.              while(TRUE) {
  29.                 r = getkey();
  30.                 if(r < 256) {
  31.                    printf("Not FK3 key");
  32.                    continue;
  33.                    }
  34.                 else r -= 256;
  35.                 if(r == FK3) printf("FK3 sensed!!!");
  36.                 }
  37.  
  38.        This function is found in SMDLx.LIB for the Datalight Compiler.
  39.