/**************************************************************************** * * KeyMacro.h ------------ KeyMacro main include file. * * Author ---------------- Olaf Barthel, MXM * Brabeckstrasse 35 * D-3000 Hannover 71 * * KeyMacro © Copyright 1990 by MXM; Executable program, * documentation and source code are shareware. If you like * this program a small donation will entitle you to receive * updates and new programs from MXM. * ****************************************************************************/ #ifndef KEYMACRO_H #define KEYMACRO_H 1 #define __NO_PRAGMAS 1 /* Standard include files. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Name of global MsgPort and program revision. */ #define PORTNAME "KeyMacro" #define REVISION 6 /* Signal flag names. */ #define SIG_CLOSE SIGBREAKF_CTRL_C #define SIG_PORT (1 << SigBit) #define SIG_SHAKE SIGBREAKF_CTRL_F /* MacroKey tag IDs */ #define MK_UNUSED 0 #define MK_WORD 1 #define MK_COMMAND 2 /* MacroMessage tad IDs */ #define MM_INPUT 0 #define MM_UPDATE 1 #define MM_EXECUTE 2 /* Maximum number of key macros. Change this if you prefer * more of less macros. */ #define MAXMACROS 30 /* KeyMacro InputEvent subclass. */ #define KM_SUBCLASS 97 /* Values for non-ASCII key codes. */ #define KC_CURSORUP 140 #define KC_CURSORDOWN 141 #define KC_CURSORRIGHT 142 #define KC_CURSORLEFT 143 #define KC_FKEY1 129 #define KC_FKEY2 130 #define KC_FKEY3 131 #define KC_FKEY4 132 #define KC_FKEY5 133 #define KC_FKEY6 134 #define KC_FKEY7 135 #define KC_FKEY8 136 #define KC_FKEY9 137 #define KC_FKEY10 138 #define KC_HELP 139 /* ToUpper macro, will also handle international characters. */ #define ToUpper(c) (((c >= 224 && c <= 254) || (c >= 'a' && c <= 'z')) ? c - 32 : c) /* Allocate public memory. */ #define AllocPub(Size) AllocRem(Size,MEMF_PUBLIC | MEMF_CLEAR) /* A keyboard alias, includes a name string and a value * to be used as an equivalent. */ struct KeyAlias { char *ka_Name; UWORD ka_Key; }; /* A MacroKey structure. */ struct MacroKey { UBYTE mk_Type; /* Type of macro key. */ UBYTE mk_CommandKey; /* Key to call this macro. */ UWORD mk_CommandQualifier; /* Qualifier needed to hold while pressing the key. */ UBYTE *mk_String; /* String to be entered/Name of command to be executed. */ UBYTE *mk_Window; /* Name of window to look for. */ }; /* A MacroMessage structure. */ struct MacroMessage { struct Message mm_Message; /* Standard Exec message. */ UBYTE mm_Type; /* Message type. */ struct MacroKey *mm_MacroKey; /* A list of macro keys. */ LONG mm_NumMacros; /* Number of macros to follow. */ struct MacroKey *mm_MacroList; /* A list of macros to add to the list. */ UBYTE *mm_FileName; /* A file to execute. */ UBYTE *mm_WindowName; /* A window title to look for. */ }; /* A MSeg structure, basically an extended MsgPort. */ struct MSeg { struct MsgPort Port; /* Standard Exec MsgPort. */ BPTR Segment; /* Pointer to handler segment. */ LONG SegSize; /* Length of MSeg structure. */ UBYTE Revision; /* Handler revision. */ struct Task *Father; /* Calling task. */ struct Task *Child; /* Waiting task. */ ULONG RingBack; /* Global wait signal. */ LONG NumMacros; /* Number of macros in list. */ struct MacroKey *MacroList; /* A list of macro keys. */ struct KeyMap *DefaultKeyMap; /* Default keymap used for key translation. */ }; #endif /* KEYMACRO_H */