home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / util2 / newkey53.lzh / EXAMPLE.KEY < prev    next >
Text File  |  1989-03-09  |  12KB  |  268 lines

  1. * This macro file illustrates many of the various functions that can be
  2. * done in Newkey.  These macros are designed to be run from the DOS command 
  3. * line.  CED should not be loaded (if you don't know what CED is then don't 
  4. * worry, you don't have it).
  5. * Illustrates beep function
  6. {begdef beep}Beep now{wait 00:00:30}{beep} beep done<esc>
  7. {enddef}
  8.  
  9. * Illustrates cls the clear screen function
  10. {begdef cls}Clear the screen {cls} clear done<esc>
  11. {enddef}
  12.  
  13. * Illustrates the cursor on and off functions
  14. {begdef cursor}Turn the cursor off {cursoff} press any key to continue
  15. {waitany}<esc>
  16. Turn cursor back on {curson}
  17. {enddef}
  18.  
  19. * Illustrates date and time function formats
  20. {begdef date}<esc>cls<enter>
  21.           Sample Date Functions                            <esc>
  22. template               what Newkey returns                 <esc>
  23.  
  24. mm/dd/yy                {date}mm/dd/yy{enddate}            <esc>
  25. yy/mm/dd                {date}yy/mm/dd{enddate}            <esc>
  26. mm-dd-yy                {date}mm-dd-yy{enddate}            <esc>
  27. mm/dd/yyyy              {date}mm/dd/yyyy{enddate}          <esc>
  28.                                                            <esc>
  29. mmmm dd, yyyy           {date}mmmm dd, yyyy{enddate}       <esc>
  30. mmm dd, yyyy            {date}mmm dd, yyyy{enddate}        <esc>
  31. dddd, mmm dd, yyyy      {date}dddd, mmm dd, yyyy{enddate}  <esc>
  32. ddd, mmm dd, yyyy       {date}ddd, mmm dd, yyyy{enddate}   <esc>
  33.    <esc>
  34.           Sample Time Functions    <esc>
  35.  
  36. template     what Newkey returns             <esc>
  37.  
  38. hh:mm:ss     {time}hh:mm:ss{endtime} = twelve hour clock time <esc>
  39. hh:mm xx     {time}hh:mm xx{endtime} = twelve hour clock time <esc>
  40. hh:mm XX     {time}hh:mm XX{endtime} = twelve hour clock time <esc>
  41. tt:mm:ss     {time}tt:mm:ss{endtime} = 24 hour clock time    <esc>
  42. <esc>
  43. Press any key to learn how you can create your own date and time 
  44. macros.{waitany}
  45. <ESC>
  46. {cls}
  47. Using the basic building blocks of the date and time functions you   <esc>
  48. can build your own date/time template.  Just type these as you would <esc>
  49. like to see them when they are played back.  You are not limited to  <esc>
  50. just these building blocks.  Any characters found in the date/time   <esc>
  51. function which can not be interpreted as one of the building blocks  <esc>
  52. will be returned just as they are.  This means that you have complete<esc>
  53. flexibility in creating your own date/time function.                 <esc>
  54.                                                                      <esc>
  55. Time functions                      Date functions                   <esc>
  56.                                                                      <esc>
  57. hh = hours on twelve hour clock     dd = day                         <esc>
  58. mm = minutes                        mm = month                       <esc>
  59. ss = seconds                        yy,yyy,yyyy = year               <esc>
  60. tt = hours on 24 hour clock         ddd,mmm = 3 char abbreviation    <esc>
  61. xx = am,pm                          dddd,mmmm = full name            <esc>
  62. XX = AM,PM                                                           <esc>
  63. {enddef}
  64.  
  65. * Illustrates begprint function
  66. {begdef print}send something to printer on LPT1
  67. {begprint}hello world!<enter>{endprint}<esc>
  68. {enddef}
  69.  
  70. * Illustrates setting caps lock
  71. {begdef caps}save caps lock status{capssave}<esc>
  72. turn caps lock on{capson} - type abc {ffld}{ffld}{ffld}<esc>
  73. turn caps lock off{capsoff} - type abc {ffld}{ffld}{ffld}<esc>
  74. restore caps lock status{capsrest}<esc>
  75. {enddef}
  76.  
  77. * Illustrates setting num lock
  78. {begdef num}save num lock status{numsave}<esc>
  79. turn num lock on{numon} - type 123 on numeric keypad {ffld}{ffld}{ffld}<esc>
  80. turn num lock off{numoff} - type 123 on numeric keypad {ffld}{ffld}{ffld}<esc>
  81. restore num lock status{numrest}<esc>
  82. {enddef}
  83.  
  84. * Illustrates setting scrl lock
  85. {begdef scrl}save scrl lock status{scrlsave}<esc>
  86. turn scrl lock on{scrlon} - no way to demonstrate from dos command line<esc>
  87. turn scrl lock off{scrloff} - no way to demonstrate from dos command line<esc>
  88. restore scrl lock status{scrlrest}<esc>
  89. {enddef}
  90.  
  91. * Illustrates time function
  92. {begdef time}current time is {time}hh:mm:ss xx{endtime}<esc>
  93. {enddef}
  94.  
  95. * Illustrates available set options
  96. {begdef setopts}Merging example.key
  97. {begmerge}example.key{endmerge} Merge is done<esc>{enddef}
  98.  
  99. * Clearing macros from memory
  100. * This macro will clear all macros from memory except for guarded macros
  101. * and the macro being used to call it.  It will take longer than the same
  102. * function done from the menu.
  103. {begdef clear}Clearing macros from memory
  104. {clearmac}Clear is done<esc>{enddef}
  105.  
  106. * Merging a macro file
  107. {begdef mergfile}Merging example.key
  108. {begmerge}example.key{endmerge} Merge is done<esc>{enddef}
  109.  
  110. * Merging a macro file overwriting duplicates
  111. {begdef mergovrw}Merging example.key overwriting duplicates
  112. {begmergo}example.key{endmergo} Merge is done<esc>{enddef}
  113.  
  114. * Loading a macro file
  115. {begdef loadfile}Loading example.key
  116. {begload}example.key{endload} Load is done<esc>{enddef}
  117.  
  118. * Saving a macro file
  119. {begdef savefile}Saving example1.key
  120. {begsave}example1.key{endsave} Save is done<esc>{enddef}
  121.  
  122. * used for translation bypass demonstration
  123. {begdef &}Hello!{enddef}
  124. {begdef alt0}level0{enddef}
  125. * nested macro demonstration
  126. {begdef alt1}level1<alt2>{enddef}
  127. {begdef alt2}level2<alt3>{enddef}
  128. {begdef alt3}level3<alt4>{enddef}
  129. {begdef alt4}level4<alt5>{enddef}
  130. {begdef alt5}level5<alt6>{enddef}
  131. {begdef alt6}level6<alt7>{enddef}
  132. {begdef alt7}level7<alt8>{enddef}
  133. {begdef alt8}level8<alt9>{enddef}
  134. {begdef alt9}level9<alt0>{enddef}
  135.  
  136. * clear screen demonstration
  137. {begdef altf1}{cls}    Clear screen macro demonstration    <esc>
  138. <esc>I am going to clear your screen.  Press any key when you are  
  139. <esc>ready.{ffld}{cls}Newkey can clear your screen whenever you wis
  140. h.{enddef}
  141.  
  142. * beep demonstration
  143. {begdef altf2}{cls}<tab>  Beep macro demonstration    <esc><esc>I 
  144. am going to beep. {beep} Newkey macros can beep {beep}<esc> wheneve
  145. r you wish.<esc>{enddef}
  146.  
  147. * screen off/on demonstration
  148. {begdef altf3}{cls}<tab>  Screen off macro demonstration    <esc>
  149. <esc>I am going to turn the screen off when you hit enter.  To turn
  150.  the screen <esc>back on press any key a couple of times.  Press en
  151. ter when ready.{vfld}  <esc>{scroff}{ffld}{ffld} <esc><esc>Now I'm 
  152. going to turn off the screen for 3 seconds and then turn it on. 
  153. <esc>Press any key when ready. {ffld}{scroff}{wait 00:03:00}
  154. {scron} <esc>{enddef}
  155.  
  156. * 5 second time delay 
  157. {begdef altt}<esc>{set slowtype off}5 second time delay begins now:
  158. {wait 00:05:00}
  159.  and ends now. <esc>{enddef}
  160.  
  161. * Macro which calls itself
  162. {begdef ctrlw}<esc>{set slowtype on}Hi! I'm <caps,>ctrlw<caps.>.  I will ca
  163. ll myself over and over until you <esc>stop me by pressing <caps,>c
  164. trlesc<caps.> (ctrl\ for enhanced), the   <esc>Newkey cancel key.  
  165. <esc>I will type slowly since I have turned on slow typing mode so 
  166. that <esc>you can follow what is happening.<esc><esc><ctrlw>
  167. {enddef}
  168.  
  169. * Fixed Length Fill-in-the-blanks Pause Demonstration
  170. {begdef f1}{cls}{set slowtype off}       Fixed length fill-in-the-blanks de
  171. monstration  <esc><esc>Enter 2 keystrokes: {ffld}{ffld} and Newkey 
  172. will finish for you.<esc>{enddef}
  173.  
  174. * Playback multi-character macro demonstration
  175. {begdef f10}{cls}<esc><esc><esc><esc><esc><esc><esc>
  176.     Playback multi-character macro demonstration    <esc>
  177. To play back a multi-character macro, follow these steps:  <esc><esc>
  178.    1.  Press <caps,>alt,<caps.>           <esc>
  179.    2.  Type in "multimac"     <esc>
  180.    3.  Press enter            <esc>{enddef}
  181.  
  182. * Variable Length Fill-in-the-blanks Pause Demonstration
  183. {begdef f2}{cls}{set slowtype off}     Variable length fill-in-the-blanks d
  184. emonstration <esc><esc>Enter any number of keystrokes followed by e
  185. nter: {vfld}   <esc>and Newkey will finish for you.      <esc>
  186. {enddef}
  187.  
  188. * Translation Bypass Demonstration
  189. {begdef f3}{cls}{set slowtype off}        Translation bypass demonstration 
  190.    <esc><esc>Enter '{notran &}' followed by enter: {vfld}<esc>You will
  191.  notice that '{notran &}' has been redefined to 'HELLO'.<esc>Now enter
  192.  ctrl-2 and '{notran &}' followed by enter: {vfld}  <esc><esc>You will
  193.  notice that '{notran &}' was returned, not 'HELLO'.  <esc>This is an 
  194. example of Newkey's translation bypass feature <esc>{enddef}
  195.  
  196. * Time Delay Demonstration
  197. {begdef f4}{cls}{set slowtype off}             Time delay demonstration    
  198.     <esc><esc>
  199. Enter ALT T.  Newkey will wait for 5 seconds before continuing. <esc>
  200. You will notice that the cursor has become a fat bar. <esc>{enddef}
  201.  
  202. * Dynamic Display Feature Demonstration 
  203. {begdef f5}{cls}{set slowtype off}
  204.             Dynamic display feature demonstration:            <esc><esc>
  205. Enter CTRL / (ALT / for enhanced).  
  206. This will allow you to invoke several <esc>Newkey functions without
  207.  leaving your current program.          <esc><esc>This feature is a
  208. lways available, no matter what program <esc>you are in.  When you 
  209. are finished Newkey will restore <esc>your screen exactly where you
  210.  left off.    <esc>{enddef}
  211.  
  212. * Slow typing mode demonstration
  213. {begdef f6}{cls}{set slowtype off}                     Slow Typing Mode Dem
  214. onstration            <esc><esc>{set slowtype on}Slow typing mode has just b
  215. een turned on.  You will notice how <esc>slowly Newkey is typing.  
  216. Now we will turn slow typing off.{set slowtype off} <esc>Notice how quickly 
  217. Newkey is typing.  Much too fast for you <esc>to follow what is hap
  218. pening.  <esc>{enddef}
  219.  
  220. * Defining macro within macro demonstration
  221. {begdef f7}{cls}{set slowtype off}<esc><esc><esc>           Defining macro 
  222. within macro demonstration            <esc><esc>This macro will def
  223. ine <caps,>ctrlq<caps.> to be whatever you type in.  <esc>Type what
  224. ever you want to and when you are done press <esc><caps,>alt-
  225. <caps.> to end it. Start now:         <esc>{begdef ctrlq}<esc>Now 
  226. that you have finished, press <caps,>ctrlq<caps.> and watch <esc>wh
  227. at you typed in returned.  Newkey will press it for  <esc>you first
  228. :<esc><ctrlq>{enddef}
  229.  
  230. * Macro calls Itself and Cancel Newkey Demonstration
  231. {begdef f8}{cls}{set slowtype off}   Macro Calls Itself and Cancel Newkey P
  232. rocessing Demonstration<esc><esc>Press <caps,>ctrlw<caps.>.  This w
  233. ill start a macro which calls itself.<esc>This macro will continue 
  234. to execute until you press the Newkey<esc>cancel processing key, 
  235. <caps,>ctrldel<caps.> (ctrl\ for enhanced).  <esc>This key cancels 
  236. all current Newkey processing and clears the keyboard <esc>buffer. 
  237. Newkey will press <caps,>ctrlw<caps.> for you.<esc><ctrlw>{enddef}
  238.  
  239. * Macro which calls Newkey's dynamic display features
  240. {begdef f9}{cls}{set slowtype off}       Macro which calls Newkey's dynamic
  241.  display features<esc><esc>This macro will actually invoke Newkey's
  242.  dynamic display features <esc>to automatically change one of the N
  243. ewkey parameters.  In this <esc>case we will turn off the screen sa
  244. ver.  Press any key when you <esc>are ready.{ffld}<esc>{cmd}4pn
  245. <esc><esc><endcmd><esc>That was easy wasn't it.<esc>{enddef}
  246.  
  247. * Multi-character macro
  248. {begdef multimac}<esc>   Hi!  I'm a multi-character macro named "m
  249. ultimac".  I am used<esc>by <caps,>f10<caps.> to demonstrate multi-
  250. character macros.<esc>{enddef}
  251.  
  252. * Multi-character macro which calls itself
  253. {begdef recurmac}<esc>{set slowtype on}Hi! I'm <caps,>recurmac<caps.>.  I w
  254. ill call myself over and over until <esc>you stop me by pressing 
  255. <caps,>ctrldel<caps.> (ctrl\ for enhanced), the  <esc>Newkey cancel
  256.  key.  <esc>I will type slowly since I have turned on slow typing m
  257. ode so that <esc>you can follow what is happening.<esc><esc>
  258. <recurmac>{enddef}
  259.