home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
328_01
/
demomacr.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-02-28
|
1KB
|
66 lines
/* demo macro
*
* shows how keyboard macro facility is installed and used.
*/
#include <stdlib.h>
#include "wtwg.h"
main ()
{
int n;
char msg[80];
WMACRO_NAMES *mn;
int key;
winit ('T');
/* Install keyboard macro routines.
* Pressing ALT= activates the amcro recorder,
* which asks for a key to assign the new macro to (ALT_1 thru ALT_0)
* then asks for a name for the file macname.mcr to store macro in.
* then begins recording all key and mouse use until next ALT=
*/
wmacro_install ();
do {
msg[0] =0;
wprompts ( "TYPE HERE", "enter word or two\n"
" use macros by pressing ALT=\n\n ",
msg, 80 );
key = wpromptc ( "ECHO", msg, NULL );
}
while ( key != ESCAPE );
/* get ptr to table of names of defined macros.
*/
mn = wmacro_names();
wclear();
for ( n=0; n<10; ++n)
{
if ( *mn[n] )
{
wprintf ("MACRO #%i name=%s\n",n,(*mn)[n] );
}
else
{
wprintf ("MACRO #%i is undefined\n", n);
}
}
wputs ("\nPress any key ");
/* wait */
wgetc();
return (0);
}