home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / tools / aurora21 / mekbd.aml < prev    next >
Text File  |  1995-08-10  |  22KB  |  571 lines

  1.  
  2. // -------------------------------------------------------------------
  3. // The Aurora Editor v2.1
  4. // Copyright 1993-1995 nuText Systems. All Rights Reserved Worldwide.
  5. //
  6. // Multi-Edit Keyboard definitions (included by MAIN.AML)
  7. //
  8. // If you have made any changes, save this file and select 'Recompile
  9. // the Editor' from the Set menu. Exit and re-enter the editor for
  10. // your changes to take effect.
  11. // -------------------------------------------------------------------
  12.  
  13. // -------------------------------------------------------------------
  14. //  Edit and File Manager windows
  15. // -------------------------------------------------------------------
  16.  
  17.   object  edit_fmgr
  18.  
  19.   // Controls
  20.   function  '≡'                                // close window
  21.     close
  22.   end
  23.  
  24.   // Menu activation
  25.   key  <esc>           gotobar                 // to last menu bar item (me)
  26.   key  <f10>           gotobar                 // to last menu bar item (me)
  27.   key  <alt f10>       gotomenu                // goto last pull-down menu
  28.   key  <alt f>         gotomenu "file"         // to file menu (me)
  29.   key  <alt w>         gotomenu "window"       // to window menu (me)
  30.   key  <alt b>         gotomenu "block"        // to block menu (me)
  31.   key  <alt s>         gotomenu "search"       // to search menu (me)
  32.   key  <alt o>         gotomenu "fold"         // to fold menu
  33.   key  <alt e>         gotomenu "edit"         // to edit menu (me)
  34.   key  <alt c>         gotomenu "clip"         // to clipboard menu
  35.   key  <alt p>         gotomenu "print"        // to print menu
  36.   key  <alt t>         gotomenu "set"          // to set menu
  37.   key  <alt m>         gotomenu "macro"        // to macro menu (me)
  38.   key  <alt h>         gotomenu "help"         // to help menu (me)
  39.   key  <f1>            gotomenu "help"         // to help menu (me)
  40.  
  41.   // Scroll
  42.   key  <pgdn>          pagedown                // scroll down (me)
  43.   key  <pgup>          pageup                  // scroll up (me)
  44.   key  <ctrl pgup>     row (getviewtop)        // to page top (me)
  45.   key  <ctrl pgdn>     row (getviewbot)        // to page bottom (me)
  46.   key  <ctrl home>     row 1                   // to file top (me)
  47.   key  <ctrl end>      row (getlines)          // to file bottom (me)
  48.   key  <center>        adjustrow               // center cursor
  49.   key  <ctrl f9>       adjustrow 1             // scroll to page top
  50.   key  <ctrl f10>      adjustrow (getviewrows) // scroll to page bottom
  51.   key  <ctrl up>       rollrow -1              // scroll up one line (me)
  52.   key  <ctrl down>     rollrow  1              // scroll down one line (me)
  53.   key  <ctrl ->        lastpos                 // to last cursor position
  54.  
  55.   // File
  56.   key  <ctrl n>        opennew                 // new edit window
  57.   key  <f3>            askopen                 // open prompt (me)
  58.   key  <alt z>         openlast                // open last window
  59.   key  <alt ->         filelist                // file list
  60.   key  <alt q>         close                   // close window
  61.   key  <alt x>         closeall                // close all windows
  62.   key  <shift f1>      quickref 'qw'           // quick function reference
  63.   key  <ctrl q><f2>    quickref 'fw'           // function reference
  64.  
  65.   // Window
  66.   key  <ctrl f6>       winlist                 // window list (me)
  67.   key  <alt f6>        maximize                // maximize window (me)
  68.   key  <alt up>        maximize                // maximize window (me)
  69.   key  <alt down>      minimize                // minimize window (me)
  70.   key  <f6>            nextwindow              // next window (me)
  71.   key  <alt right>     nextwindow              // next window (me)
  72.   key  <shift f6>      prevwindow              // prev window (me)
  73.   key  <alt left>      prevwindow              // prev window (me)
  74.   key  <shift f3>      tile 'v'                // tile vertical
  75.   key  <shift f4>      tile 'h'                // tile horizontal
  76.   key  <ctrl k><q>     close                   // close window
  77.  
  78.   // Search
  79.   key  <ctrl f>        askscan                 // file scan prompt (me)
  80.   key  <ctrl e>        gotomark 't'            // find top of block (me)
  81.   key  <ctrl c>        gotomark 'b'            // find bot of block (me)
  82.   key  <ctrl 6>        cyclebook               // cycle through bookmarks
  83.  
  84.   // Print
  85.   key  <ctrl p>        print                   // print
  86.  
  87.   // Set
  88.   key  <ctrl f1>       togglemode              // toggle video mode
  89.   key  <ctrl k><f2>    recompile               // recompile the editor
  90.  
  91.   // Macro
  92.   key  <ctrl v>        askeval                 // macro command prompt
  93.   key  <alt f9>        askrun                  // DOS command prompt
  94.   key  <alt f8>        askruncap               // DOS capture prompt
  95.   key  <f9>            shell                   // exit to DOS
  96.   key  <shift f12>     pickmacro               // macro picklist
  97.   key  <ctrl f12>      runmac "maclist"        // macro menu
  98.  
  99.   // undefined or unnamed keys
  100.   key <otherkey> (keycode)
  101.     say (getkeyname (keycode)) + " not defined"
  102.   end
  103.  
  104.  
  105. // -------------------------------------------------------------------
  106. //  Prompts and Edit windows
  107. // -------------------------------------------------------------------
  108.  
  109.   object  prompt
  110.  
  111.   // Controls
  112.   function  '≡'        close                   // close window
  113.   end
  114.  
  115.   function  '*'        enter                   // simulate <enter>
  116.   end                                          //  (2-line box only)
  117.  
  118.   // Cursor
  119.   key  <left>          left                    // move cursor left (me)
  120.   key  <right>         right                   // move cursor right (me)
  121.   key  <home>          col 1                   // to column one (me)
  122.   key  <end>           col  getlinelen + 1     // to end of line (me)
  123.  
  124.   // Cursor + CUA-marking
  125.   key  <shift left>    left
  126.                        smark
  127.   key  <shift right>   right
  128.                        smark
  129.   key  <shift home>    col 1
  130.                        smark
  131.   key  <shift end>     col getlinelen + 1
  132.                        smark
  133.  
  134.   // Editing
  135.   key  <ins>           setting 'I' TOGGLE      // toggle insert mode
  136.   key  <del>           delchar                 // delete character (me)
  137.   key  <backspace>     backsp                  // delete left character (me)
  138.  
  139.   key  <ctrl del>                              // erase to end of line (me)
  140.     if shiftkey? then
  141.       delchar (getlinelen)
  142.     end
  143.   end
  144.  
  145.   key  <alt =>         asciilist               // display ascii chart
  146.  
  147.   // Block
  148.   key  <ctrl f7>       markstream              // mark stream (me)
  149.   key  <shift f7>      markcolumn              // mark column (me)
  150.   key  <alt 1>         markword                // mark word
  151.   key  <alt 2>         markeol                 // mark to end of line
  152.   key  <alt u>         destroymark             // unmark
  153.  
  154.   // copy block to prompt (me)
  155.   key  <f8>
  156.                        instext (getmarktext)
  157.                        col  getlinelen + 1
  158.  
  159.   // paste from clipboard to prompt (me)
  160.   key  <greyenter>
  161.                        oldmark = usemark _ClipName
  162.                        instext (getmarktext)
  163.                        usemark oldmark
  164.                        col  getlinelen + 1
  165.  
  166.   // copy from prompt to clipboard (me)
  167.   key  <grey+>         copy
  168.   key  <ctrl ins>      copy
  169.  
  170.   // Prompt history
  171.   key  <up>            prevhist                // retrieve prev prompt
  172.   key  <down>          nexthist                // retrieve next prompt
  173.   key  <pgup>          askhistory              // history popup menu
  174.   key  <pgdn>          askhistory              // history popup menu
  175.  
  176.   // Exit
  177.   key  <esc>           close                   // quit prompt
  178.   key  <alt q>         close                   // quit prompt
  179.  
  180.   // non-function keys
  181.   key  <char> (character)                      // typeable keys
  182.     write character
  183.   end
  184.  
  185.   // filename completion
  186.   key  <ctrl tab>      askcomplete             // filename completion
  187.   key  <tab>           askcomplete             // filename completion
  188.   end
  189.  
  190.  
  191. // -------------------------------------------------------------------
  192. //  Edit windows
  193. // -------------------------------------------------------------------
  194.  
  195.   object  edit
  196.  
  197.   // Controls
  198.   function  '≡'
  199.     close                                      // close window
  200.   end
  201.  
  202.   // Menu
  203.   key  <esc>           gotobar                 // to last menu bar item (me)
  204.  
  205.   // Cursor
  206.   key  <up>            up                      // move cursor up (me)
  207.   key  <down>          down                    // move cursor down (me)
  208.  
  209.   // Cursor + CUA-marking
  210.   key  <shift up>      up
  211.                        smark
  212.   key  <shift down>    down
  213.                        smark
  214.  
  215.   key  <enter>         enter                   // enter key
  216.   key  <del>           delchar2                // delete character (me)
  217.   key  <backspace>     backsp                  // delete left char (me)
  218.  
  219.   key  <ctrl del>
  220.     if shiftkey? then
  221.       // pass on to prompt object
  222.       pass                                     // erase to end-of-line (me)
  223.     else
  224.       delword _CSet                            // delete right word (me)
  225.     end
  226.   end
  227.  
  228.   key  <home>                                  // timed-home key (me)
  229.     if getcol > getlinebeg then
  230.       col (getlinebeg)
  231.     else
  232.       if getcol == 1 then
  233.         if timer? "_h" then
  234.           row (if? getrow == getviewtop 1 (getviewtop))
  235.         end
  236.       end
  237.       settimer "_h" 350
  238.       col 1
  239.     end
  240.   end
  241.  
  242.   key  <end>                                   // timed-end key (me)
  243.     if timer? "_e" then
  244.       if getcol == getlinelen + 1 then
  245.         row (if? getrow == getviewbot (getlines) (getviewbot))
  246.       end
  247.     end
  248.     col getlinelen + 1
  249.     settimer "_e" 350
  250.   end
  251.  
  252.   key  <tab>           tabright                // tab right (me)
  253.   key  <ctrl i>        tabright                // indent (me)
  254.   key  <shift tab>     tableft                 // tab left
  255.  
  256.   key  <ctrl left>     prevword                // find left word (me)
  257.                        smark                   // cua marking
  258.   key  <ctrl right>    nextword                // find right word (me)
  259.                        smark                   // cua marking
  260.  
  261.   // Scroll
  262.   key  <pgdn>          pagedown                // page down (me)
  263.   key  <pgup>          pageup                  // page up (me)
  264.  
  265.   // Scroll + CUA-marking
  266.   key  <shift pgdn>    pagedown
  267.                        smark
  268.   key  <shift pgup>    pageup
  269.                        smark
  270.  
  271.   key  <ctrl pgup>     row (getviewtop)        // to page top (me)
  272.                        smark
  273.   key  <ctrl t>        call <ctrl pgup>
  274.  
  275.   key  <ctrl pgdn>     row (getviewbot)        // to page bottom (me)
  276.                        smark
  277.   key  <ctrl b>        call <ctrl pgdn>
  278.  
  279.   key  <ctrl home>     row 1                   // to file top (me)
  280.                        smark
  281.   key  <ctrl end>      row (getlines)          // to file bottom (me)
  282.                        smark
  283.  
  284.   key  <ctrl up>       rollrow -1              // scroll up one line (me)
  285.                        smark
  286.   key  <ctrl down>     rollrow  1              // scroll down one line (me)
  287.                        smark
  288.  
  289.   // File
  290.   key  <alt i>         askinsert               // open and insert prompt
  291.   key  <ctrl ]>        openword                // open file at cursor
  292.   key  <alt n>         askname                 // rename prompt
  293.   key  <f2>            save                    // save file (me)
  294.   key  <ctrl f2>       asksaveas               // save file as (me)
  295.   key  <f4>            open "*.*"              // display file manager
  296.   key  <alt q>         close                   // close file/window
  297.   key  <ctrl x>        close 's'               // save & close file/window
  298.  
  299.   // Window
  300.   key  <ctrl q><c>     copywin                 // copy window
  301.   key  <ctrl q><h>     splitwin 'h'            // split window horizontal
  302.   key  <alt v>         splitwin 'v'            // split window vertical
  303.  
  304.   // Block
  305.   key  <f7>            markline                // mark line (me)
  306.   key  <alt 3>         markpara "tb"           // mark paragraph
  307.   key  <f8>            copyblock2              // copy block (me)
  308.   key  <shift f8>      moveblock2              // move block (me)
  309.   key  <ctrl m>        moveblockover           // move block over
  310.   key  <ctrl f8>       deleteblock2            // delete block (me)
  311.   key  <alt f2>        shiftblock -1           // unindent block (me)
  312.   key  <alt f3>        shiftblock  1           // indent block (me)
  313.   key  <ctrl k><f>     fillblock2              // fill block with string
  314.   key  <alt r>         formatblock2            // reformat block
  315.   key  <alt y>         formatblock2 "rj"       // reformat & right just block
  316.   key  <shift f2>      saveblock2              // save block (me)
  317.   key  <ctrl k><o>     sortblock2              // sort block
  318.   key  <ctrl k><u>     caseblock               // change block to uppercase
  319.   key  <shift f9>      quote                   // quote a block
  320.   key  <ctrl k><c>     justblock2 'c'          // center a block
  321.  
  322.   // Search
  323.   key  <f5>            askfind                 // find prompt (me)
  324.   key  <shift f5>      askrepl                 // replace prompt (me)
  325.   key  <ctrl q><i>     isearch                 // incremental search
  326.   key  <ctrl h>        askfindo                // find occurrences
  327.  
  328.   key  <ctrl f5>       findlast                // do last find/replace (me)
  329.   key  <ctrl 2>        quickbook               // set quick bookmark
  330.   key  <alt f5>        askrow                  // go to line prompt (me)
  331.   key  <alt 7>         search2 "f/f"           // go to next fold
  332.   key  <ctrl [>        gotomatch2              // find matching char
  333.   key  <alt f7>        gotoerror               // go to compiler error
  334.  
  335.   // Fold
  336.   key  <alt 8>         foldline                // fold next line
  337.   key  <alt 9>         foldline 'u'            // unfold next line
  338.   key  <alt g>         destroyfold2            // destroy closed/open fold
  339.   key  <ctrl q><f>     foldblock2              // fold block
  340.   key  <alt \>                                 // open or close fold
  341.     if fold? then
  342.        openfold
  343.     else
  344.        closefold
  345.     end
  346.   end
  347.   key  <alt 0>         foldall 'ds'            // destroy all folds
  348.   key  <alt [>         foldall 'os'            // open all folds
  349.   key  <alt ]>         foldall 'cs'            // close all folds
  350.  
  351.   // Edit
  352.   key  <ctrl enter>    insline2                // insert line
  353.  
  354.   key  <alt backspace>                         // delete line (me)
  355.     if shiftkey? then
  356.       delline
  357.     else
  358.       undo                                     // undo last change (me)
  359.     end
  360.   end
  361.   key  <alt enter>     redo                    // redo last change (me)
  362.  
  363.   key <ctrl backspace>
  364.     if shiftkey? then                          // backspace to home (me)
  365.       delchar getcol - 1 1
  366.       col 1
  367.     else                                       // backspace a word (me)
  368.       if getcol > 1 then
  369.         left
  370.         c = getchar
  371.         delchar
  372.         p = poschar ' ' + _CSet c
  373.         if p then
  374.           while getcol > 1 and (poschar (if? c == ' ' ' ' _CSet) (getchar getcol - 1)) do
  375.             left
  376.             delchar
  377.           end
  378.         end
  379.       else
  380.         // let EXT.AML backsp handle config defaults
  381.         backsp
  382.       end
  383.     end
  384.   end
  385.  
  386.   key  <alt j>         joinline                // join line
  387.   key  <alt 4>         insline (gettext)       // duplicate line
  388.   key  <alt 5>         swapline                // swap line
  389.   key  <alt 6>         centerline              // center line
  390.   key  <alt f1>        commentline             // comment/uncomment line
  391.   key  <ctrl k><t>     timestamp               // date/time stamp
  392.   key  <ctrl k><x>     tabfile                 // expand tabs
  393.   key  <ctrl \>        hiliteword              // highlight words
  394.  
  395.   // Clipboard
  396.   key  <grey->         cut                     // cut (me)
  397.   key  <shift del>     cut                     // cut (me)
  398.   key  <ctrl grey->    cut 'a'                 // cut append (me)
  399.   key  <grey+>         copy                    // copy (me)
  400.  
  401.   key  <ctrl ins>
  402.     if shiftkey? then
  403.       paste 'w'                                // paste from Windows (me)
  404.     else
  405.       copy                                     // copy (me)
  406.     end
  407.   end
  408.  
  409.   key  <ctrl grey+>    copy 'a'                // copy append (me)
  410.   key  <greyenter>     paste                   // paste (me)
  411.   key  <shift ins>     paste                   // paste (me)
  412.   key  <ctrl grey*>    paste 'o'               // paste over
  413.   key  <ctrl grey/>    clear                   // clear clipboard
  414.  
  415.   key  <alt ins>
  416.     if shiftkey? then                          // copy to Windows (me)
  417.       copy 'w'
  418.     else
  419.       pass
  420.     end
  421.   end
  422.  
  423.   // Set
  424.   key  <ctrl w>        setting 'L' TOGGLE      // live word wrap toggle
  425.   key  <ctrl d>        setting 'D' TOGGLE      // line draw toggle
  426.   key  <alt f4>        setting 'T' TOGGLE      // text translate toggle
  427.  
  428.   // Macro
  429.   key  <shift f10>     compilemacro2 (getbufname)  // compile current file
  430.   key  <shift f11>     runmacro2 (getbufname)      // run current file
  431.  
  432.   // non-function (typeable) keys
  433.   key  <char> (character)                      // typeable keys
  434.     write character
  435.   end
  436.  
  437.   // Other
  438.   key  <ctrl q><q>     askrepkey               // repeat entered keys
  439.  
  440.   // invoke a spell checker from within an edit window
  441.   // (replace 'jspell' with your favorite spell checker)
  442.   key  <f11>
  443.     save                                       // save the current file
  444.     run  "jspell " + getbufname  "ck"          // call spellchecker
  445.     reopen                                     // reopen current file
  446.   end
  447.  
  448. // -------------------------------------------------------------------
  449. //  File Manager windows
  450. // -------------------------------------------------------------------
  451.  
  452.   object  fmgr
  453.  
  454.   // Menu activation
  455.   key  <tab>           gotobar2                // to drive menu bar
  456.  
  457.   // Cursor
  458.   key  <left>          rollcol -1              // scroll left one column
  459.   key  <right>         rollcol  1              // scroll right one column
  460.   key  <home>          col 1                   // scroll to column one
  461.  
  462.   key  <up>            up                      // move cursor up
  463.   key  <down>          down                    // move cursor down
  464.  
  465.   key  <shift up>      fmark                   // mark files
  466.                        up
  467.   key  <shift down>    fmark                   // mark files
  468.                        down
  469.  
  470.   // file manager commands (single character command codes)
  471.   key  <char> (c)
  472.  
  473.     // toggle file mark
  474.     if c == ' ' then
  475.       fmark
  476.  
  477.     // <shift-character> commands
  478.     elseif shiftkey? then
  479.       case  locase c
  480.         when 'o'     fopen 'o'                   // open file/directory
  481.         when 'e'     fopen 'e'                   // open file/directory
  482.         when 'z'     fopen "ze"                  // open maximized
  483.         when 'b'     fopen 'b'                   // open binary file
  484.         when 'y'     fopen "be"                  // open binary in one window
  485.         when 'k'     openkey2 (getffile)         // open key macro file
  486.         when 'm'     fmove                       // move file
  487.         when 'c'     fcopy                       // copy file
  488.         when 'd'     fdelete                     // delete file
  489.         when 'n'     frename                     // rename file
  490.         when 'r'     frun 'c'                    // run program/batch file
  491.         when 'p'     fprint                      // print file
  492.         when 'a'     fattr                       // change file attributes
  493.         when 't'     ftouch                      // touch file
  494.  
  495.         // spell checker
  496.         when 's'     run "jspell " + getffile  "ck"
  497.  
  498.         // unarchive .ZIP or .LZH files
  499.         when 'u'
  500.           f = getffile
  501.           run (if? (pos ".lzh" f 'i') "lha e " "pkunzip ") + f  "ck"
  502.           reopen
  503.  
  504.         // view .ZIP or .LZH archives
  505.         when 'v'
  506.           f = getffile
  507.           runcap (if? (pos ".lzh" f 'i') "lha v " "pkunzip -v ") + f
  508.       end
  509.  
  510.     // hotkey to files
  511.     else
  512.       onhotkey c
  513.     end
  514.  
  515.   // File
  516.   key  <ctrl backspace>   fup                  // parent directory
  517.  
  518.   // Mark
  519.   key  <alt m>         fmark "ma"              // mark all files
  520.   key  <alt u>         fmark "ua"              // unmark all
  521.  
  522.   // Command
  523.   key  <enter>         fopen '1'               // open file (one only)
  524.   key  <ctrl enter>    fopen 'q'               // open file (close fmgr)
  525.   key  <del>           fdelete                 // delete file
  526.  
  527.   // Sort
  528.   key  <alt n>         fsort 'n'               // sort by name
  529.   key  <alt s>         fsort 's'               // sort by size
  530.   key  <alt d>         fsort 'd'               // sort by date/time
  531.   key  <alt o>         fsort 'o'               // no sort (DOS order)
  532.  
  533.   // Print
  534.   key  <ctrl p>        print                   // print fmgr contents
  535.   end
  536.  
  537.  
  538. // -------------------------------------------------------------------
  539. //  Movable/Sizable windows
  540. // -------------------------------------------------------------------
  541.  
  542.   object  win
  543.  
  544.   // scroll lock down
  545.   function  scrlockdown            // move/size with kbd (me)
  546.     sizekey
  547.     pass
  548.   end
  549.   // scroll lock down
  550.   function  scrlockup              // move/size with kbd (me)
  551.     sizekey
  552.     pass
  553.   end
  554.  
  555.  
  556. // -------------------------------------------------------------------
  557. //  All windows
  558. // -------------------------------------------------------------------
  559.  
  560.   object  mon
  561.  
  562.   // key macros
  563.   key  <ctrl r>        record                  // toggle record setting
  564.   key  <ctrl q><e>     play                    // play scrap key macro
  565.  
  566.   // define multi-key prefixes
  567.   key  <ctrl k>        prefix <ctrl k>         // define <ctrl k> prefix
  568.   key  <ctrl o>        prefix <ctrl o>         // define <ctrl o> prefix
  569.   key  <ctrl q>        prefix <ctrl q>         // define <ctrl q> prefix
  570.  
  571.