home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / test / intactv.4th < prev    next >
Encoding:
Text File  |  1994-11-24  |  2.4 KB  |  98 lines

  1. \
  2. \ intactv.4th --- test some interactive features
  3. \ (duz 13May94)
  4. \
  5.  
  6. MARKER FORGET-INTERACTIVE-TESTS
  7.  
  8. \ Screen
  9.  
  10. CLS
  11.  
  12. S" This is the center of a blank screen. Key..."
  13. COLS OVER - 2/ 1- ROWS 2/ 1- AT-XY TYPE KEY DROP
  14.  
  15. CLS        .( Testing text attributes on screen:         ) CR CR
  16. NORMAL        .( This is NORMAL text. ) CR
  17. HIGHLIGHT    .( This text is HIGHLIGHTed.                  )
  18. -HIGHLIGHT    .(  This is again NORMAL text. ) CR
  19. UNDERLINE    .( This text is UNDERLINEd.                   )
  20. -UNDERLINE    .(  This is again NORMAL text. ) CR
  21. INTENSITY    .( This text is displayed with more INTENSITY.)
  22. -INTENSITY    .(  This is again NORMAL text. ) CR
  23. BLINKING    .( This is BLINKING text.                     )
  24. -BLINKING    .(  This is again NORMAL text. ) CR
  25. REVERSE        .( This text is displayed in REVERSE video.   )
  26. -REVERSE    .(  This is again NORMAL text. ) CR
  27.  
  28. D FD WAIT
  29.  
  30. \ Keyboard
  31.  
  32. CLS .( Now testing the keyboard. )
  33.  
  34. : EMPTY-INPUT    10 0 DO
  35.             20 MS
  36.             EKEY? IF  EKEY DROP  ELSE  LEAVE  THEN
  37.         LOOP ;
  38.  
  39. : TEST-KEY    CR ." Press "
  40.         SAVE-INPUT        BL PARSE TYPE SPACE
  41.         RESTORE-INPUT DROP    EKEY ' EXECUTE =
  42.         IF    ."  Thanks! "
  43.         ELSE  ."  Not recognized." EMPTY-INPUT
  44.         THEN ;
  45.  
  46. CR
  47. CR .( Please press the requested keys to see if pfe detects them right.)
  48. CR .( K-PRIOR and K-NEXT are page up/down on many keyboards.)
  49. CR .( If your keyboard has no such key, just press any other and live)
  50. CR .( with it.)
  51. CR
  52.  
  53. TEST-KEY K-LEFT
  54. TEST-KEY K-RIGHT
  55. TEST-KEY K-UP
  56. TEST-KEY K-DOWN
  57. TEST-KEY K-HOME
  58. TEST-KEY K-END
  59. TEST-KEY K-PRIOR
  60. TEST-KEY K-NEXT
  61.  
  62. TEST-KEY K1    TEST-KEY K2    TEST-KEY K3    TEST-KEY K4    TEST-KEY K5
  63. TEST-KEY K6    TEST-KEY K7    TEST-KEY K8    TEST-KEY K9    TEST-KEY K10
  64.  
  65. D
  66. CR
  67. CR .( Disappointed?)
  68. CR .( Many -- most -- systems have bad termcap files. You can get all keys)
  69. CR .( to work if you edit your /etc/termcap file and insert the k0 through)
  70. CR .( k9 and some other items. Consult your system's documentation.)
  71. WAIT
  72.  
  73. \ Forth words on function keys K1 through K10:
  74.  
  75. CLS
  76. CR
  77. CR .( You can bind Forth definitions to the keys K0 through K10.)
  78. CR .( Now testing this feature.)
  79. CR
  80.  
  81. : PRINT-ME ." Yeah!" ;
  82. K1 EXECUTES PRINT-ME
  83. CR .( Please press K1 and then return ... ) CR
  84. PAD 10 ACCEPT DROP
  85. CR .( It's ok if he said `Yeah!' )
  86. : SET-K2 K2 EXECUTES PRINT-ME ;
  87. SET-K2
  88. CR .( Now please press K2 and return ... ) CR
  89. PAD 10 ACCEPT DROP
  90. CR .( Did he say `Yeah!' again? )
  91. K1 EXECUTES NOOP
  92. K2 EXECUTES NOOP
  93. D
  94.  
  95. \ end of intactv.4th
  96.  
  97. FORGET-INTERACTIVE-TESTS
  98.