* This macro file illustrates many of the various functions that can be * done in Newkey. These macros are designed to be run from the DOS command * line. * * CED should not be loaded (if you don't know what CED is then don't * worry, you don't have it). * * Illustrates if functions - This macro will do a "dir/p" and clear * all "Stike a key" messages until the directory listing is done. It does * this by starting the directory listing and then calling to * do rest of processing. {begdef chkdir}dir /p {enddef} * Part 2 of if function example - Logic is as follows: * * Wait for 1/2 second to give directory listing time to fill screen * If "bytes free" displayed then exit, directory listing is done * If "Strike a key" displayed, then screen is full, "strike" the enter * key to continue. * Branch to start of macro to repeat process {begdef chkdir1} {wait 00:00:50} {ifefscr}bytes free{endifef}{return} {ifefscr} key to c{endifef} {enddef} * Illustrates print screen function {begdef prtscrn}Print screen{prtscrn} {enddef} * Illustrates beep function {begdef beep}Beep now{wait 00:00:30}{beep} beep done {enddef} * Illustrates cls the clear screen function {begdef cls}Clear the screen {cls} clear done {enddef} * Illustrates the cursor on and off functions {begdef cursor}Turn the cursor off {cursoff} press any key to continue {waitany} Turn cursor back on {curson} {enddef} * Illustrates date and time function formats {begdef date}cls Sample Date Functions template what Newkey returns mm/dd/yy {date}mm/dd/yy{enddate} yy/mm/dd {date}yy/mm/dd{enddate} mm-dd-yy {date}mm-dd-yy{enddate} mm/dd/yyyy {date}mm/dd/yyyy{enddate} mmmm dd, yyyy {date}mmmm dd, yyyy{enddate} mmm dd, yyyy {date}mmm dd, yyyy{enddate} dddd, mmm dd, yyyy {date}dddd, mmm dd, yyyy{enddate} ddd, mmm dd, yyyy {date}ddd, mmm dd, yyyy{enddate} Sample Time Functions template what Newkey returns hh:mm:ss {time}hh:mm:ss{endtime} = twelve hour clock time hh:mm xx {time}hh:mm xx{endtime} = twelve hour clock time hh:mm XX {time}hh:mm XX{endtime} = twelve hour clock time tt:mm:ss {time}tt:mm:ss{endtime} = 24 hour clock time Press any key to learn how you can create your own date and time macros.{waitany} {cls} Using the basic building blocks of the date and time functions you can build your own date/time template. Just type these as you would like to see them when they are played back. You are not limited to just these building blocks. Any characters found in the date/time function which can not be interpreted as one of the building blocks will be returned just as they are. This means that you have complete flexibility in creating your own date/time function. Time functions Date functions hh = hours on twelve hour clock dd = day mm = minutes mm = month ss = seconds yy,yyy,yyyy = year tt = hours on 24 hour clock ddd,mmm = 3 char abbreviation xx = am,pm dddd,mmmm = full name XX = AM,PM {enddef} * Illustrates begprint function {begdef print}send something to printer on LPT1 {begprint}hello world!{endprint} {enddef} * Illustrates setting caps lock {begdef caps}save caps lock status{capssave} turn caps lock on{capson} - type abc {ffld}{ffld}{ffld} turn caps lock off{capsoff} - type abc {ffld}{ffld}{ffld} restore caps lock status{capsrest} {enddef} * Illustrates setting num lock {begdef num}save num lock status{numsave} turn num lock on{numon} - type 123 on numeric keypad {ffld}{ffld}{ffld} turn num lock off{numoff} - type 123 on numeric keypad {ffld}{ffld}{ffld} restore num lock status{numrest} {enddef} * Illustrates setting scrl lock {begdef scrl}save scrl lock status{scrlsave} turn scrl lock on{scrlon} - no way to demonstrate from dos command line turn scrl lock off{scrloff} - no way to demonstrate from dos command line restore scrl lock status{scrlrest} {enddef} * Illustrates time function {begdef time}current time is {time}hh:mm:ss xx{endtime} {enddef} * Illustrates available set options {begdef setopts}Merging example.key {begmerge}example.key{endmerge} Merge is done{enddef} * Clearing macros from memory * This macro will clear all macros from memory except for guarded macros * and the macro being used to call it. It will take longer than the same * function done from the menu. {begdef clear}Clearing macros from memory {clearmac}Clear is done{enddef} * Merging a macro file {begdef mergfile}Merging example.key {begmerge}example.key{endmerge} Merge is done{enddef} * Merging a macro file overwriting duplicates {begdef mergovrw}Merging example.key overwriting duplicates {begmergo}example.key{endmergo} Merge is done{enddef} * Loading a macro file {begdef loadfile}Loading example.key {begload}example.key{endload} Load is done{enddef} * Saving a macro file {begdef savefile}Saving example1.key {begsave}example1.key{endsave} Save is done{enddef} * used for translation bypass demonstration {begdef &}Hello!{enddef} * {begdef alt0}level0{enddef} * nested macro demonstration {begdef alt1}level1{enddef} * {begdef alt2}level2{enddef} * {begdef alt3}level3{enddef} * {begdef alt4}level4{enddef} * {begdef alt5}level5{enddef} * {begdef alt6}level6{enddef} * {begdef alt7}level7{enddef} * {begdef alt8}level8{enddef} * {begdef alt9}level9{enddef} * clear screen demonstration {begdef altf1}{cls} Clear screen macro demonstration I am going to clear your screen. Press any key when you are ready.{ffld}{cls}Newkey can clear your screen whenever you wis h.{enddef} * beep demonstration {begdef altf2}{cls} Beep macro demonstration I am going to beep. {beep} Newkey macros can beep {beep} wheneve r you wish.{enddef} * screen off/on demonstration {begdef altf3}{cls} Screen off macro demonstration I am going to turn the screen off when you hit enter. To turn the screen back on press any key a couple of times. Press en ter when ready.{vfld} {scroff}{ffld}{ffld} Now I'm going to turn off the screen for 3 seconds and then turn it on. Press any key when ready. {ffld}{scroff}{wait 00:03:00} {scron} {enddef} * 5 second time delay {begdef altt}{set slowtype off}5 second time delay begins now: {wait 00:05:00} and ends now. {enddef} * Macro which calls itself {begdef ctrlw}{set slowtype on}Hi! I'm ctrlw. I will ca ll myself over and over until you stop me by pressing c trldel, the Newkey cancel key. I will type slowly since I have turned on slow typing mode so that you can follow what is happening. {enddef} * Fixed Length Fill-in-the-blanks Pause Demonstration {begdef f1}{cls}{set slowtype off} Fixed length fill-in-the-blanks de monstration Enter 2 keystrokes: {ffld}{ffld} and Newkey will finish for you.{enddef} * Playback multi-character macro demonstration {begdef f10}{cls} Playback multi-character macro demonstration To play back a multi-character macro, follow these steps: 1. Press alt, 2. Type in "multimac" 3. Press enter {enddef} * Variable Length Fill-in-the-blanks Pause Demonstration {begdef f2}{cls}{set slowtype off} Variable length fill-in-the-blanks d emonstration Enter any number of keystrokes followed by e nter: {vfld} and Newkey will finish for you. {enddef} * Translation Bypass Demonstration {begdef f3}{cls}{set slowtype off} Translation bypass demonstration Enter '{notran &}' followed by enter: {vfld}You will notice that '{notran &}' has been redefined to 'HELLO'.Now enter ctrl-2 and '{notran &}' followed by enter: {vfld} You will notice that '{notran &}' was returned, not 'HELLO'. This is an example of Newkey's translation bypass feature {enddef} * Time Delay Demonstration {begdef f4}{cls}{set slowtype off} Time delay demonstration Enter ALT T. Newkey will wait for 5 seconds before continuing. You will notice that the cursor has become a fat bar. {enddef} * Dynamic Display Feature Demonstration {begdef f5}{cls}{set slowtype off} Dynamic display feature demonstration: Enter ALT /. This will allow you to invoke several Newkey functions without leaving your current program. This feature is a lways available, no matter what program you are in. When you are finished Newkey will restore your screen exactly where you left off. {enddef} * Slow typing mode demonstration {begdef f6}{cls}{set slowtype off} Slow Typing Mode Dem onstration {set slowtype on}Slow typing mode has just b een turned on. You will notice how slowly Newkey is typing. Now we will turn slow typing off.{set slowtype off} Notice how quickly Newkey is typing. Much too fast for you to follow what is hap pening. {enddef} * Defining macro within macro demonstration {begdef f7}{cls}{set slowtype off} Defining macro within macro demonstration This macro will def ine ctrlq to be whatever you type in. Type what ever you want to and when you are done press alt- to end it. Start now: {begdef ctrlq}Now that you have finished, press ctrlq and watch wh at you typed in returned. Newkey will press it for you first :{enddef} * Macro calls Itself and Cancel Newkey Demonstration {begdef f8}{cls}{set slowtype off} Macro Calls Itself and Cancel Newkey P rocessing DemonstrationPress ctrlw. This w ill start a macro which calls itself.This macro will continue to execute until you press the Newkeycancel processing key, ctrldel This key cancels all current Newkey processing and clears the keyboard buffer. Newkey will press ctrlw for you.{enddef} * Multi-character macro {begdef multimac} Hi! I'm a multi-character macro named "m ultimac". I am usedby f10 to demonstrate multi- character macros.{enddef} * Multi-character macro which calls itself {begdef recurmac}{set slowtype on}Hi! I'm recurmac. I w ill call myself over and over until you stop me by pressing ctrldel, the Newkey cancel key. I will type slowly since I have turned on slow typing m ode so that you can follow what is happening. {enddef}