home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Database / CLIPR503.W96 / KEYBOARD.PR_ / KEYBOARD.PR
Text File  |  1995-06-20  |  633b  |  34 lines

  1. /***
  2. *
  3. *  Keyboard.prg
  4. *
  5. *  Sample keyboard routines
  6. *
  7. *  Copyright (c) 1993-1995, Computer Associates International Inc.
  8. *  All rights reserved.
  9. *
  10. *  Note: Compile with /N /W options
  11. *
  12. */
  13.  
  14.  
  15. /***
  16. *
  17. *  InKeyWait( <nSecs> ) --> nInkeyCode
  18. *
  19. *  Similar to INKEY(), except services SET KEYs
  20. *
  21. */
  22. FUNCTION InKeyWait( nSecs )
  23.  
  24.    LOCAL nKey        // INKEY() value to return
  25.    LOCAL bKeyBlock   // Code block retrieved and performed for nKey, if any
  26.  
  27.    nKey := INKEY( nSecs )
  28.  
  29.    IF ( bKeyBlock := SETKEY( nKey ) ) != NIL
  30.       EVAL( bKeyBlock, PROCNAME( 2 ), PROCLINE( 2 ) )
  31.    ENDIF
  32.  
  33.    RETURN( nKey )
  34.