home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a067 / 1.img / GRUMP501.EXE / GKBASIC.PRG < prev    next >
Encoding:
Text File  |  1991-05-02  |  1.4 KB  |  62 lines

  1. /*
  2.     Function: GKeyBasic()
  3.     Purpose:  test for hot keys and all basic keys used for exiting GETs
  4.               this is a separate function so that the code need not be
  5.               duplicated in each special keypress module
  6.     Author:   Greg Lief
  7.     Copyright (c) 1991 Greg Lief
  8.     Dialect:  Clipper 5.01
  9. */
  10.  
  11. #include "inkey.ch"
  12. #include "getexit.ch"
  13.  
  14. function GKeyBasic( get, key )
  15. local bKeyBlock := SetKey(key)
  16. local ret_val := .t.
  17. //───── check for SET KEY first
  18. if bKeyBlock != NIL
  19.    GetDoSetKey(bKeyBlock, get)
  20. else
  21.    do case
  22.  
  23.       case ( key == K_UP )
  24.          get:exitState := GE_UP
  25.  
  26.       case ( key == K_SH_TAB )
  27.          get:exitState := GE_UP
  28.  
  29.       case ( key == K_DOWN )
  30.          get:exitState := GE_DOWN
  31.  
  32.       case ( key == K_TAB )
  33.          get:exitState := GE_DOWN
  34.  
  35.       case ( key == K_ENTER )
  36.          get:exitState := GE_ENTER
  37.  
  38.       case ( key == K_ESC )
  39.          if ( Set(_SET_ESCAPE) )
  40.             get:undo()
  41.             get:exitState := GE_ESCAPE
  42.          endif
  43.  
  44.       case ( key == K_PGUP )
  45.          get:exitState := GE_WRITE
  46.  
  47.       case ( key == K_PGDN )
  48.          get:exitState := GE_WRITE
  49.  
  50.       case ( key == K_CTRL_HOME )
  51.          get:exitState := GE_TOP
  52.  
  53.       // both ^W and ^End terminate the READ (the default)
  54.       case (key == K_CTRL_W)
  55.          get:exitState := GE_WRITE
  56.  
  57.       otherwise
  58.          ret_val := .f.
  59.    endcase
  60. endif
  61. return (ret_val)
  62.