!~Filename~:! KBDMAC !& Setup KBDMAC Library:! m.m^R Start Kbd Macrou:.x(() m.m^R End Kbd Macrou:.x()) m.m^R Call Lastu:.x(E) m.m^R Kbd Macro Queryu:.x(Q) :i*m.vLast Kbd Macro :i*Kbd Macro Querym.vKbd Macro Query 20.*5fsqvectoru..m q..m[..ohk !& Run Kbd Macro:! fq..m/5-3[2 q:..m(q2)[0 q:..m(%2)[1 q1:g0*200.+(%1:g0)fsreread %1u:..m(q2) q1-fq0"l0' q:..m(%2)-1u0 q0f"nf"gu:..m(q2)' 37u:..m(q2-1)0' q..m[..ozj-15d z"e0fstyisource' 0 !& Immediate Kbd Macro:! q..m[..o fstyisource"ehk' zj15,0i -1fsbackstr,.-15fsword 37,.-10fsword ff"e1'"#',.-5fsword m.m& Run Kbd Macrofstyisource 0 !^R Call Last Kbd Macro:! f:mLast Kbd Macro !^R Start Kbd Macro:! 0fsbcons[1 q1m.vKbd Macro Defining Body ff"n mLast Kbd Macro q1[..o gLast Kbd Macro j37dzj' m.m& Define Kbd Macrofstyisink fsvers-751"g1fsmodech' 0 !& Define Kbd Macro:! qKbd Macro Defining Body[..ozj /200.i&177.i0 !^R End Kbd Macro:! fstyisink"e@fenimfserr' 0fstyisink qKbd Macro Defining Body[..o zjfstyicount-(fstyibeg)*2r.,zk ji!temp!fm(m.m& Immediate Kbd Macro) hx*m.vLast Kbd Macro Q..o(]..o )fsbkill fsvers-751"g1fsmodech' -1"e0' f"g-1'mLast Kbd Macro' 0 !Name Kbd Macro:! 1,f Function name: [1 fq1"gqLast Kbd Macrom.vMM 1' FF"E @ftPut kbd macro on key:  m(m.m& Read Q-reg)[2 @ft Go ahead1m(m.m& Yes or No)"e0' qLast Kbd Macrou2' 0 !View Kbd Macro:! 1,f Function name: [0 fq0"e@ftCommand key:  m(m.m& Read Q-reg)u0' "#:i0MM 0' q0[1 m.m^R Call Last Kbd-q1"e qLast Kbd Macrou1 :i0Last Kbd Macro' f[bbind1: j6f~!temp!"n :i*Not a kbd macrofserr' js)0,.k ft Definition of keyboard macro:   m.m& Charprint[2 jz/2<1a*200.+(2c0a)m2ft > ft  0 !& Check Redefinition:! [1 q1[0 fq0+1"g f~(0,6:g0)!Temp!"n !lose!!"!:I*Can't clobber specified character 1fserr'' "#Afs^rinit-q0"n 200.@fs^rinit-q0"n q0"n olose''''  !^R Kbd Macro Query:! ff"n0fstyisink( 0fstyisource( [..j:i..jKbd Macro Edit 0 )fstyisource )fstyisink 0' fstyisource"e0' [0[1QKbd Macro Query[..j 0fstyisource(0fstyisink( !Read! 2,m.i@:fiu1fiu0 q0- "ef+Oread' q0-"e0Oread' )fstyisink )fstyisource q0-32"e0' q0-."e1u:..m(fq..m/5-1)0' q0-"e1u:..m(fq..m/5-1)' q0f:"l fq:..m(fq..m/5-3)-2u:..m(fq..m/5-2) fi' 0fstyisource q1fsreread !Write Kbd Macro:! 1,f Function name:  QF[0 fq0"e@ftCommand key:  m(m.m& Read Q-reg)u0' "#:i0MM F' q0[1 m.m^R Call Last Kbd-q1"e qLast Kbd Macrou1 :i0Last Kbd Macro' f[bbind1: j6f~!temp!"n :i*Not a kbd macrofserr' f[dfile1f[fnamsyntax etKMAC :EJ 1m(m.m& Read Filename)Output file[2 jm(m.mReplace String) _ jm(m.mReplace String)   jm(m.mReplace String)\\ et2 i!~Filename~:! !Saved keyboard macro.! fsdfn1:F6[3 i3 14.i fqF"EQ3uF' i !:! !F:! !S 0 KBD Macro.! [1 1,m(m.m&_Get_Library_Pointer)KBDMAC"e m(m.mLoad_Library)KBDMAC' @:i1\ zji\fm10 1,m.m& File PURIFY Loaded+1"G m(m.mLoad Library)PURIFY' m(m.m& Compress Buffer) m(m.m& Purify Buffer) et2 ei@hpef fsofileu2 @ft Written: 2 0fsechoactive 0 !Kbd Test End of Buffer:! fstyisource"n .-z"e0fstyisource'' 0 !~DOC~ ~Filename~:! Defining and calling keyboard macros. !~DOC~ & Setup KBDMAC Library:! S Put commands on keys. Create execution stack. !~DOC~ & Run Kbd Macro:! S This is the FS TYI SOURCE for running keyboard macros. !~DOC~ & Immediate Kbd Macro:! S Push a kbd macro onto the execution stack of such. Supply the repeat count as pre-comma argument and a string pointer to the macro as post-comma argument. !~DOC~ ^R Call Last Kbd Macro:! ^R Run the last defined temporary keyboard macro. A numeric argument is a repeat count. !~DOC~ ^R Start Kbd Macro:! ^R Begin defining keyboad macro. After you type this command, everything you type becomes part of the accumulating keyboard macro as well as being executed. Numeric arg means append to last defined keyboard macro, repeating its definition as if you typed it in from scratch. !~DOC~ & Define Kbd Macro:! S FS TYI SINK for defining kbd macros. Takes characters typed and accumulates them in a buffer which will be formed into a keyboard macro when the definition is finished. !~DOC~ ^R End Kbd Macro:! ^R Terminate definition of a keyboard macro. All that you have typed since starting the definition, except this command itself, becomes the definition. An argument means re-execute the macro immediately, with the argument as repeat count, counting defining the macro as once. ^R Call Last Kbd Macro re-executes the last macro defined. !~DOC~ Name Kbd Macro:! C Give a name to the last kbd macro defined. A function is created with the name you specify, which when invoked runs that keyboard macro. (Return means give no name.) Then, you are asked to give the command character to put the macro on. Type C-G if you don't want one. Combinations with prefix characters such as Altmode and C-X may be used. Call this function with any numeric argument to inhibit its asking for a key. !~DOC~ View Kbd Macro:! C Print definition of a keyboard macro. Supply a suffix string argument containing the command name. If the string argument is null, you will be asked to type the character which runs the macro. !~DOC~ & Check Redefinition:! S Verify that a certain command can be redefined. Do not allow a command to be redefined unless it is undefined, self-inserting, or a string starting with !Temp!. The command is specified with a q-register name in a string passed as a string pointer. !~DOC~ ^R Kbd Macro Query:! ^R Query and continue macro execution. If called from a macro, reads a character: Space continues execution. Rubout terminates this repetition of the macro. Altmode terminates all repetitions of the macro. . terminates after the end of this repetition of the macro. ^R enters a recursive edit; when you exit, you are asked again. ^L clears the screen and asks you again. Anything else exits all macros and is reread as a command. With an argument, we unconditionally enter a recursive editing level and proceed with the macro when it is exited. This is the same as what we do with no argument if the user were to type ^R Space; but it is done even when the macro is being defined. !~DOC~ Write Kbd Macro:! C Write macro to file. Supply a suffix string argument containing the command name. If the string argument is null, you will be asked to type the character which runs the macro. The output file name will read from the terminal (default KMAC :EJ). To replay the macro, use the normal Load Library or Run Library functions. !~DOC~ Kbd Test End of Buffer:! C Quit KBD macro execution if at end of buffer. !~DIRECTORY~:! & Setup KBDMAC Library & Run Kbd Macro & Immediate Kbd Macro ^R Call Last Kbd Macro ^R Start Kbd Macro & Define Kbd Macro ^R End Kbd Macro Name Kbd Macro View Kbd Macro & Check Redefinition ^R Kbd Macro Query Write Kbd Macro Kbd Test End of Buffer