home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / DOS / TEKST / AURORA2 / WPKBD.AML < prev    next >
Text File  |  1995-04-28  |  21KB  |  588 lines

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