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