home *** CD-ROM | disk | FTP | other *** search
/ Shareware 1 2 the Maxx / sw_1.zip / sw_1 / EDITORS / TDE20.ZIP / DEFAULT.H < prev    next >
Text File  |  1992-06-05  |  17KB  |  344 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 returned 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-256 (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.  * **************************************************************************
  28.  * **** In tde, version 1.4, I added support for assigning characters    ****
  29.  * **** to Control and Alt keys.  This allows those who need various     ****
  30.  * **** accent and dot characters to assign any ASCII or Extended ASCII  ****
  31.  * **** character to unused function keys.                               ****
  32.  * **************************************************************************
  33.  *
  34.  * **************************************************************************
  35.  * **** In tde, version 1.5, I took out support for assigning characters ****
  36.  * **** to Control and Alt keys.  Macros may now be assigned to function ****
  37.  * **** keys, which will accomplish the same task.                       ****
  38.  * **************************************************************************
  39.  *
  40.  * If you change the default key assignments, you should also change the help
  41.  * screen in help.h to show what function the new keys are assigned to.
  42.  *
  43.  * The insert_overwrite function is assigned the index of 0.  If the key
  44.  * code is less than 256 then a character is written to the file.  DO NOT
  45.  * assign any function to 256, it is used to call insert_overwrite( ) and
  46.  * add text characters to the file.  DO NOT put an index to it in the
  47.  * cfgkeys utility.
  48.  */
  49.  
  50. unsigned char key_func[MAX_KEYS] = {
  51. /* 256 */
  52.      0,                     /* DO NOT assign this to any function */
  53.      0,                     /* Alt + ESC  -  101 Keyboard */
  54.      AbortCommand,          /* ESC    - manually map to 258 */
  55.      0,                     /* #ESC   - manually map to 259 */
  56. /* 260 */                   
  57.      ClearAllMacros,        /* ^ESC    - mannuall map to 260 */
  58.      0,                     /* no key assigned here */
  59.      Rturn,                 /*  Enter  - manually map to 262 */
  60.      NextLine,              /* #Enter  - manually map to 263 */
  61.      BegNextLine,           /* ^Enter  - manually map to 264 */
  62.      BackSpace,             /*  BackSpace - manually map to 265 */
  63.      BackSpace,             /* #BackSpace - manually map to 266 */
  64.      0,                     /* ^BackSpace - manually map to 267 */
  65.      Tab,                   /*  Tab       - manually map to 268 */
  66.      0,                     /* Control-Break - manually map to 269
  67.                              *    DO NOT assign any function to Control-Break.
  68.                              *    It is used to stop run away functions.
  69.                              */
  70. /* 270 */                   
  71.      0,                     /* Alt + Backspace  - 101 keyboard */
  72.      BackTab,               /* Shift + Tab */
  73.      Quit,                  /* Alt-Q  272 */
  74.      BlockToFile,           /* Alt-W  273 */
  75.      BlockExpandTabs,       /* Alt-E  274 */
  76.      ToggleRuler,           /* Alt-R  275 */
  77.      BlockTrimTrailing,     /* Alt-T  276 */
  78.      UndoDelete,            /* ALT-Y  277 */
  79.      UnMarkBlock,           /* Alt-U  278 */
  80.      ToggleIndent,          /* Alt-I  279 */
  81. /* 280 */                   
  82.      OverlayBlock,          /* Alt-O  280 */
  83.      PrintBlock,            /* Alt-P  281 */
  84.      0,                     /* Alt-[     - 101 keyboard */
  85.      0,                     /* Alt-]     - 101 keyboard */
  86.      0,                     /* Alt-Enter - 101 keyboard */
  87.      0,                     /* manually map Grey Enter to this hole */
  88.      AddLine,               /* Alt-A  286 */
  89.      SortBoxBlock,          /* Alt-S  287 */
  90.      DeleteLine,            /* Alt-D  288 */
  91.      FillBlock,             /* Alt-F  289 */
  92. /* 290 */                   
  93.      DeleteBlock,           /* Alt-G  290 */
  94.      Help,                  /* Alt-H  291 */
  95.      JoinLine,              /* Alt-J  292 */
  96.      KopyBlock,             /* Alt-K  293 */
  97.      MarkLine,              /* Alt-L  294 */
  98.      0,                     /* Alt-;: - 101 keyboard */
  99.      0,                     /* Alt-'" - 101 keyboard */
  100.      0,                     /* Alt-`~ - 101 keyboard */
  101.      0,                     /* manually map Shift+Grey Enter to this hole */
  102.      0,                     /* manually map Control+Greay Enter to this hole */
  103. /* 300 */                   
  104.      ToggleZ,               /* Alt-Z  300 */
  105.      MarkStream,            /* Alt-X  301 */
  106.      CopyBlock,             /* Alt-C  302 */
  107.      ToggleWordWrap,        /* Alt-V  303 */
  108.      MarkBox,               /* Alt-B  304 */
  109.      NumberBlock,           /* Alt-N  305 */
  110.      MoveBlock,             /* Alt-M  306 */
  111.      BlockUpperCase,        /* Alt-<  added for 83/84 keyboards, fmd */
  112.      BlockLowerCase,        /* Alt->  added for 83/84 keyboards, fmd */
  113.      BlockStripHiBit,       /* ALt-?  added for 83/84 keyboards, fmd */
  114. /* 310 */                   
  115.      0,                     /*  hole in key codes, not used */
  116.      0,                     /*  hole in key codes, not used */
  117.      0,                     /*  hole in key codes, not used */
  118.      0,                     /*  hole in key codes, not used */
  119.      0,                     /*  hole in key codes, not used */
  120.      Help,                  /* F1     315 */
  121.      Save,                  /* F2     316 */
  122.      Quit,                  /* F3     317 */
  123.      File,                  /* F4     318 */
  124.      RepeatFindForward1,    /* F5     319 */
  125. /* 320 */                   
  126.      RepeatFindBackward1,   /* F6     320 */
  127.      0,                     /* F7     321 */
  128.      SplitVertical,         /* F8     322 */
  129.      SplitHorizontal,       /* F9     323 */
  130.      NextWindow,            /* F10    324 */
  131.      0,                     /*  hole in key codes, not used */
  132.      0,                     /*  hole in key codes, not used */
  133.      BegOfLine,             /* Home   327 */
  134.      LineUp,                /* Up     328 */
  135.      ScreenUp,              /* PgUp   329 */
  136. /* 330 */                   
  137.      0,                     /*  hole in key codes, not used */
  138.      CharLeft,              /* Left   331 */
  139.      CenterWindow,          /* Center 332 */
  140.      CharRight,             /* Right  333 */
  141.      0,                     /*  hole in key codes, not used */
  142.      EndOfLine,             /* End    335 */
  143.      LineDown,              /* Down   336 */
  144.      ScreenDown,            /* PgDn   337 */
  145.      ToggleOverWrite,       /* Ins    338 */
  146.      DeleteChar,            /* Del    339 */
  147. /* 340 */                   
  148.      SaveMacro,             /* Shift F1  */
  149.      SaveAs,                /* Shift F2  */
  150.      LoadMacro,             /* Shift F3  */
  151.      EditFile,              /* Shift F4  */
  152.      FindForward,           /* Shift F5  */
  153.      FindBackward,          /* Shift F6  */
  154.      ReplaceForward,        /* Shift F7  */
  155.      ReplaceBackward,       /* Shift F8  */
  156.      SizeWindow,            /* Shift F9  */
  157.      PreviousWindow,        /* Shift F10 */
  158. /* 350 */                   
  159.      ToggleSync,            /* Control F1 */
  160.      ToggleEol,             /* Control F2 */
  161.      ToggleCRLF,            /* Control F3 */
  162.      ToggleTrailing,        /* Control F4 */
  163.      ToggleSearchCase,      /* Control F5 */
  164.      SetLeftMargin,         /* Control F6 */
  165.      SetRightMargin,        /* Control F7 */
  166.      SetParagraphMargin,    /* Control F8 */
  167.      ZoomWindow,            /* Control F9  */
  168.      NextHiddenWindow,      /* Control F10 */
  169. /* 360 */                   
  170.      DirList,               /* Alt-F1   360 */
  171.      SetFileAttributes,     /* Alt-F2   361 */
  172.      RecordMacro,           /* Alt-F3   362 */
  173.      EditNextFile,          /* Alt-F4   363 */
  174.      RepeatFindForward2,    /* Alt-F5   364 */
  175.      RepeatFindBackward2,   /* Alt-F6   365 */
  176.      FormatParagraph,       /* Alt-F7   366 */
  177.      LeftJustify,           /* Alt-F8   367 */
  178.      RightJustify,          /* Alt-F9   368 */
  179.      CenterJustify,         /* Alt-F10  369 */
  180. /* 370 */                   
  181.      0,                     /*  hole in key codes, not used */
  182.      WordLeft,              /* Control Left  371 */
  183.      WordRight,             /* Control Right 372 */
  184.      BotOfScreen,           /* Control End   373 */
  185.      EndOfFile,             /* Control PgUp  374 */
  186.      TopOfScreen,           /* Control Home  375 */
  187.      SetMark1,              /* Alt-1! */
  188.      SetMark2,              /* Alt-2@ */
  189.      SetMark3,              /* Alt-3# */
  190.      0,                     /* Alt-4$ */
  191. /* 380 */                   
  192.      0,                     /* Alt-5% */
  193.      0,                     /* Alt-6^ */
  194.      0,                     /* Alt-7& */
  195.      0,                     /* Alt-8* */
  196.      0,                     /* Alt-9( */
  197.      0,                     /* Alt-0) */
  198.      DelEndOfLine,          /* Alt '-'  386      */
  199.      DuplicateLine,         /* Alt '='  387      */
  200.      TopOfFile,             /* Control Pgup  388 */
  201.      0,                     /* F11          - 101 keyboard */
  202. /* 390 */                   
  203.      0,                     /* F12          - 101 keyboard */
  204.      0,                     /* Shift F11    - 101 keyboard */
  205.      0,                     /* Shift F12    - 101 keyboard */
  206.      0,                     /* Control F11  - 101 keyboard */
  207.      0,                     /* Control F12  - 101 keyboard */
  208.      0,                     /* Alt F11      - 101 keyboard */
  209.      0,                     /* Alt F12      - 101 keyboard */
  210.      ScrollUpLine,          /* Control Up */
  211.      FixedScrollUp,         /* Control Grey - */
  212.      CenterLine,            /* Control Center */
  213. /* 400 */                   
  214.      FixedScrollDn,         /* Control Grey + */
  215.      ScrollDnLine,          /* Control Down   */
  216.      0,                     /* Control Ins    */
  217.      StreamDeleteChar,      /* Control Del    */
  218.      SetTabs,               /* Control TAB    */
  219.      0,                     /* Control Grey /  */
  220.      0,                     /* Control Grey *  */
  221.      0,                     /* Alt + Grey Home  */
  222.      FixedScrollUp,         /* Alt + Grey Up    */
  223.      HorizontalScreenLeft,  /* Alt + Grey PgUp  */
  224. /* 410 */                   
  225.      0,                     /*  hole in key codes, not used */
  226.      ScrollLeft,            /* Alt + Grey Left  */
  227.      0,                     /*  hole in key codes, not used */
  228.      ScrollRight,           /* Alt + Grey Right */
  229.      0,                     /*  hole in key codes, not used */
  230.      0,                     /* Alt + Grey End   */
  231.      FixedScrollDn,         /* Alt + Grey Down  */
  232.      HorizontalScreenRight, /* Alt + Grey PgDn  */
  233.      0,                     /* Alt + Grey Ins   */
  234.      0,                     /* Alt + Grey Del   */
  235. /* 420 */                   
  236.      0,                     /* Alt + Grey /     */
  237.      ToggleSmartTabs,       /* Alt + Tab        */
  238.      0,                     /* Alt + Grey Enter */
  239.      ScrollUpLine,          /* Shift Grey - (Num Lock off), fmd key */
  240.      ScrollDnLine,          /* Shift Grey + (Num Lock off), fmd  key */
  241.      Rturn,                 /* Hard code Enter to 425 - DO NOT let users
  242.                              * change, used in the reassignment of
  243.                              * ALT-013 <lf> */
  244.      ScrollLeft,            /* hard code - control+shift+left, fmd key  */
  245.      ScrollRight,           /* hard code - control+shift+right, fmd key */
  246.      0,                     /* no keys are assigned here */
  247.      0,                     /* no keys are assigned here */
  248.  
  249.    /*
  250.     * Add 430 to keycodes 0-31 if ALT key is not pressed.  This effectively
  251.     * remaps the Control code sequence to 430-461.
  252.     */
  253.  
  254. /* 430 */
  255.      DateTimeStamp,         /* Control @ - remapped in main.c */
  256.      WordLeft,              /* Control a */
  257.      FormatText,            /* Control b */
  258.      ScreenDown,            /* Control c */
  259.      CharRight,             /* Control d */
  260.      LineUp,                /* Control e */
  261.      WordRight,             /* Control f */
  262.      DeleteChar,            /* Control g */
  263.      BackSpace,             /* Control h */
  264.      Tab,                   /* Control i */
  265.      Help,                  /* Control j */
  266.      0,                     /* Control k */
  267.      0,                     /* Control l */
  268.      Rturn,                 /* Control m */
  269.      AddLine,               /* Control n */
  270.      0,                     /* Control o */
  271.      Pause,                 /* Control p */
  272.      0,                     /* Control q */
  273.      ScreenUp,              /* Control r */
  274.      CharLeft,              /* Control s */
  275.      WordDelete,            /* Control t */
  276.      UndoDelete,            /* Control u */
  277.      ToggleOverWrite,       /* Control v */
  278.      ScrollUpLine,          /* Control w */
  279.      LineDown,              /* Control x */
  280.      DeleteLine,            /* Control y */
  281.      ScrollDnLine,          /* Control z */
  282.      AbortCommand,          /* Control [ */
  283.      RedrawScreen,          /* Control \ */
  284.      ParenBalance,          /* Control ] */
  285. /* 460 */
  286.      0,                     /* Control ^     460 */
  287.      SplitLine,             /* Control _     461 */
  288.      GotoMark1,             /* Shift Alt 1!  462 */
  289.      GotoMark2,             /* Shift Alt 2@  463 */
  290.      GotoMark3,             /* Shift Alt 3#  464 */
  291.      0,                     /* Shift Alt 4$  465 */
  292.      0,                     /* Shift Alt 5%  466 */
  293.      0,                     /* Shift Alt 6^  467 */
  294.      0,                     /* Shift Alt 7&  468 */
  295.      0,                     /* Shift Alt 8*  469 */
  296. /* 470 */
  297.      0,                     /* Shift Alt 9(  470 */
  298.      0,                     /* Shift Alt 0)  471 */
  299.      0,                     /* Shift Alt -_  472 */
  300.      0,                     /* Shift Alt +=  473 */
  301.      0,                     /* Shift Alt-Q   474 */
  302.      0,                     /* Shift Alt-W   475 */
  303.      0,                     /* Shift Alt-E   476 */
  304.      0,                     /* Shift Alt-R   477 */
  305.      0,                     /* Shift Alt-T   478 */
  306.      0,                     /* Shift ALT-Y   479 */
  307. /* 480 */
  308.      0,                     /* Shift Alt-U   480 */
  309.      0,                     /* Shift Alt-I   481 */
  310.      0,                     /* Shift Alt-O   482 */
  311.      0,                     /* Shift Alt-P   483 */
  312.      0,                     /* Shift Alt-[     - 101 keyboard */
  313.      0,                     /* Shift Alt-]     - 101 keyboard */
  314.      0,                     /* Shift Alt-Enter - 101 keyboard */
  315.      0,                     /* hole in the key codes here */
  316.      0,                     /* Shift Alt-A   488 */
  317.      0,                     /* Shift Alt-S   489 */
  318. /* 490 */
  319.      0,                     /* Shift Alt-D   490 */
  320.      0,                     /* Shift Alt-F   491 */
  321.      0,                     /* Shift Alt-G   492 */
  322.      0,                     /* Shift Alt-H   493 */
  323.      0,                     /* Shift Alt-J   494 */
  324.      0,                     /* Shift Alt-K   495 */
  325.      0,                     /* Shift Alt-L   496 */
  326.      0,                     /* Shift Alt-;: - 101 keyboard */
  327.      0,                     /* Shift Alt-'" - 101 keyboard */
  328.      0,                     /* Shift Alt-`~ - 101 keyboard */
  329. /* 500 */
  330.      0,                     /* hole in the key codes here */
  331.      0,                     /* see pages 194-195 of MASM man. for more info */
  332.      0,                     /* Shift Alt-Z   502 */
  333.      0,                     /* Shift Alt-X   503 */
  334.      0,                     /* Shift Alt-C   504 */
  335.      0,                     /* Shift Alt-V   505 */
  336.      0,                     /* Shift Alt-B   506 */
  337.      0,                     /* Shift Alt-N   507 */
  338.      0,                     /* Shift Alt-M   508 */
  339.      0,                     /* Shift Alt-<  added for 83/84 keyboards, fmd */
  340. /* 510 */
  341.      0,                     /* Shift Alt->  added for 83/84 keyboards, fmd */
  342.      0                      /* Shift ALt-?  added for 83/84 keyboards, fmd */
  343. };
  344.