home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / EDITOR / TDE120.ZIP / DEFAULT.H < prev    next >
Encoding:
Text File  |  1991-10-05  |  9.8 KB  |  237 lines

  1. /*
  2.  * New editor name:  tde, the Thomson-Davis Editor.
  3.  * Author:           Frank Davis
  4.  * Date:             June 5, 1991
  5.  *
  6.  * This modification of Douglas Thomson's code is released into the
  7.  * public domain, Frank Davis.  You may distribute it freely.
  8.  *
  9.  * Set up default dispatch table.
  10.  *
  11.  * If you want to change the default key assignments - it's really easy.  All
  12.  * you have to do is set the appropriate array element to the desired function
  13.  * and then recompile the source code.  The available functions are in the
  14.  * define.h file.
  15.  *
  16.  * The key code return by pressing a function key is added to 256.  This is
  17.  * done because it makes it easy to allow the ASCII and Extended ASCII
  18.  * characters to get thru as normal characters and to trap the function keys
  19.  * because they are greater than 256.  Once a function is detected, 256 is
  20.  * subtracted from the key code which maps the function key codes to
  21.  * 0-206 (MAX_KEYS).  See function getfunc( ) at the bottom of main.c.
  22.  *
  23.  * Look in the back of the MSC 6.0a manual or a MASM manual to find out what
  24.  * the extended codes are for the various key combinations.  For example,
  25.  * ALT+M = 50.  Add 50 to 256 which equals 306.
  26.  *
  27.  * If you change the default key assignments, you should also change the help
  28.  * screen (in help.h) to show what function the new key is assigned to.
  29.  *
  30.  * The insert_overwrite function is assigned the index of 0.  If the key
  31.  * code is less than 256 then a character is written to the file.  Since
  32.  * all function codes are greater than 256, no function key is added to file.
  33.  */
  34.  
  35. DISPATCH_TABLE key_func[MAX_KEYS] = {
  36.    /* 256 */
  37.     0,                          /* DO NOT assign this to any function */
  38.     0,                          /* Alt + ESC  -  101 Keyboard */
  39.     AbortCommand,               /* ESC    - manually map to 258 */
  40.     0,                          /* Control + 2 */
  41.    /* 260 */
  42.     0,                          /* #ESC    - manually map to 260 */
  43.     0,                          /* ^ESC    - mannuall map to 261 */
  44.     Rturn,                      /*  Enter  - manually map to 262 */
  45.     NextLine,                   /* #Enter  - manually map to 263 */
  46.     BegNextLine,                /* ^Enter  - manually map to 264 */
  47.     BackSpace,                  /*  BackSpace - manually map to 265 */
  48.     BackSpace,                  /* #BackSpace - manually map to 266 */
  49.     0,                          /* ^BackSpace - manually map to 267 */
  50.     Tab,                        /*  Tab       - manually map to 268 */
  51.     0,
  52.    /* 270 */
  53.     0,                          /* Alt + Backspace  - 101 keyboard */
  54.     0,                          /* Shift + Tab    */
  55.     0,                          /* Alt-Q  272 */
  56.     BlockToFile,                /* Alt-W  273 */
  57.     BlockExpandTabs,            /* Alt-E  274 */
  58.     0,
  59.     SetTabs,                    /* Alt-T  276 */
  60.     UndoDelete,                 /* ALT-Y  277 */
  61.     UnMarkBlock,                /* Alt-U  278 */
  62.     ToggleIndent,               /* Alt-I  279 */
  63.    /* 280 */
  64.     OverlayBlock,               /* Alt-O  280 */
  65.     PrintBlock,                 /* Alt-P  281 */
  66.     0,                          /* Alt-[     - 101 keyboard */
  67.     0,                          /* Alt-]     - 101 keyboard */
  68.     0,                          /* Alt-Enter - 101 keyboard */
  69.     0,
  70.     AddLine,                    /* Alt-A  286 */
  71.     SplitLine,                  /* Alt-S  287 */
  72.     DeleteLine,                 /* Alt-D  288 */
  73.     FillBlock,                  /* Alt-F  289 */
  74.    /* 290 */
  75.     DeleteBlock,                /* Alt-G  290 */
  76.     Help,                       /* Alt-H  291 */
  77.     JoinLine,                   /* Alt-J  292 */
  78.     KopyBlock,                  /* Alt-K  293 */
  79.     MarkLine,                   /* Alt-L  294 */
  80.     0,                          /* Alt-;  - 101 keyboard */
  81.     0,                          /* Alt-\  - 101 keyboard */
  82.     0,                          /* Alt-~  - 101 keyboard */
  83.     0,
  84.     0,
  85.    /* 300 */
  86.     JumpToLine,                 /* Alt-Z  300 */
  87.     0,
  88.     CopyBlock,                  /* Alt-C  302 */
  89.     0,
  90.     MarkBlock,                  /* Alt-B  304 */
  91.     0,
  92.     MoveBlock,                  /* Alt-M  306 */
  93.     0,                          /* Alt-<  - 101 keyboard */
  94.     0,                          /* Alt->  - 101 keyboard */
  95.     0,                          /* ALt-?  - 101 keyboard */
  96.    /* 310 */
  97.     0,  0,  0,  0,  0,
  98.     Help,                       /* F1     315 */
  99.     Save,                       /* F2     316 */
  100.     Quit,                       /* F3     317 */
  101.     File,                       /* F4     318 */
  102.     RepeatFindForward,          /* F5     319 */
  103.    /* 320 */
  104.     RepeatFindBackward,         /* F6     320 */
  105.     0,  0,
  106.     SplitScreen,                /* F9     323 */
  107.     NextWindow,                 /* F10    324 */
  108.     0,  0,
  109.     BegOfLine,                  /* Home   327 */
  110.     LineUp,                     /* Up     328 */
  111.     ScreenUp,                   /* PgUp   329 */
  112.    /* 330 */
  113.     0,
  114.     CharLeft,                   /* Left   331 */
  115.     CenterWindow,               /* Center 332 */
  116.     CharRight,                  /* Right  333 */
  117.     0,
  118.     EndOfLine,                  /* End    335 */
  119.     LineDown,                   /* Down   336 */
  120.     ScreenDown,                 /* PgDn   337 */
  121.     ToggleOverWrite,            /* Ins    338 */
  122.     DeleteChar,                 /* Del    339 */
  123.    /* 340 */
  124.     0,
  125.     SaveAs,                     /* Shift  F2 */
  126.     0,
  127.     EditFile,                   /* Shift F4  */
  128.     FindForward,                /* Shift F5  */
  129.     FindBackward,               /* Shift F6  */
  130.     ReplaceForward,             /* Shift F7  */
  131.     ReplaceBackward,            /* Shift F8  */
  132.     SizeWindow,                 /* Shift F9  */
  133.     PreviousWindow,             /* Shift F10 */
  134.    /* 350 */
  135.     0,  0,  0,  0,
  136.     ToggleSearchCase,           /* Control F5 */
  137.     0,  0,  0,
  138.     ZoomWindow,                 /* Control F9 */
  139.     NextHiddenWindow,           /* Control F10 */
  140.    /* 360 */
  141.     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,   /* Alt-F1 thru Alt-F10 */
  142.    /* 370 */
  143.     0,
  144.     WordLeft,                   /* Control Left  371 */
  145.     WordRight,                  /* Control Right 372 */
  146.     BotOfScreen,                /* Control End   373 */
  147.     EndOfFile,                  /* Control PgUp  374 */
  148.     TopOfScreen,                /* Control Home  375 */
  149.     0,                          /* Alt-! */
  150.     0,                          /* Alt-@ */
  151.     0,                          /* Alt-# */
  152.     0,                          /* Alt-$ */
  153.    /* 380 */
  154.     0,                          /* Alt-% */
  155.     0,                          /* Alt-^ */
  156.     0,                          /* Alt-& */
  157.     0,                          /* Alt-* */
  158.     0,                          /* Alt-( */
  159.     0,                          /* Alt-) */
  160.     DelEndOfLine,               /* Alt '-'  386      */
  161.     DuplicateLine,              /* Alt '='  387      */
  162.     TopOfFile,                  /* Control Pgup  388 */
  163.     0,                          /* F11          - 101 keyboard */
  164.    /* 390 */
  165.     0,                          /* F12          - 101 keyboard */
  166.     0,                          /* Shift F11    - 101 keyboard */
  167.     0,                          /* Shift F12    - 101 keyboard */
  168.     0,                          /* Control F11  - 101 keyboard */
  169.     0,                          /* Control F12  - 101 keyboard */
  170.     0,                          /* Alt F11      - 101 keyboard */
  171.     0,                          /* Alt F12      - 101 keyboard */
  172.     ScrollUpLine,              /* Control Up */
  173.     FixedScrollUp,             /* Control Grey - */
  174.     CenterLine,                /* Control Center */
  175.    /* 400 */               
  176.     FixedScrollDn,             /* Control Grey + */
  177.     ScrollDnLine,              /* Control Down  */
  178.     0,                     
  179.     ToggleSdel,                /* Control Del   */
  180.     0,  0,  0,  0,         
  181.     FixedScrollUp,             /* Alt + Grey Up */
  182.     0,
  183.    /* 410 */
  184.     0,
  185.     HorizontalScreenLeft,       /* Alt + Grey Left  */
  186.     0,
  187.     HorizontalScreenRight,      /* Alt + Grey Right */
  188.     0,  0,
  189.     FixedScrollDn,       /* Alt + Grey Down */
  190.     0,  0,  0,
  191.    /* 420 */
  192.     0,  0,  0,
  193.     ScrollUpLine,       /* Shift Grey - (Num Lock off) */
  194.     ScrollDnLine,       /* Shift Grey + (Num Lock off) */
  195.     Rturn,              /* Hard code Enter to 425 - DO NOT let users change */
  196.     0,  0,  0,  0,      /* no keys are assigned here */
  197.  
  198.    /*
  199.     * Add 430 to keycodes 0-31 if ALT key is not pressed.  This effectively
  200.     * remaps the Control code sequence to 430-461.
  201.     */
  202.  
  203.    /* 430 */
  204.     0,
  205.     WordLeft,           /* Control a */
  206.     BackSpace,          /* Control b */
  207.     ScreenDown,         /* Control c */
  208.     CharRight,          /* Control d */
  209.     LineUp,             /* Control e */
  210.     WordRight,          /* Control f */
  211.     DeleteChar,         /* Control g */
  212.     BackSpace,          /* Control h */
  213.     Tab,                /* Control i */
  214.     Help,               /* Control j */
  215.     0,                  /* Control k */
  216.     0,                  /* Control l */
  217.     Rturn,              /* Control m */
  218.     AddLine,            /* Control n */
  219.     0,                  /* Control o */
  220.     0,                  /* Control p */
  221.     0,                  /* Control q */
  222.     ScreenUp,           /* Control r */
  223.     CharLeft,           /* Control s */
  224.     WordDelete,         /* Control t */
  225.     UndoDelete,         /* Control u */
  226.     ToggleOverWrite,    /* Control v */
  227.     ScrollUpLine,       /* Control w */
  228.     LineDown,           /* Control x */
  229.     DeleteLine,         /* Control y */
  230.     ScrollDnLine,       /* Control z */
  231.     AbortCommand,       /* Control [ */
  232.     RedrawScreen,       /* Control \ */
  233.     ParenBalance,       /* Control ] */
  234.    /* 460 */
  235.     0,  0
  236. };
  237.