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

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