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

  1.  
  2. /* ------------------------------------------------------------------ */
  3. /* Macro:        KEYDEF.AML                                           */
  4. /* Written by:   nuText Systems                                       */
  5. /*                                                                    */
  6. /* Description:  This macro displays a popup menu showing assigned    */
  7. /*               and unassigned keys for the current window type      */
  8. /*               (edit windows or file manager windows). If the       */
  9. /*               current window is an edit window, selecting a key    */
  10. /*               from the popup menu will enter it into the text at   */
  11. /*               the cursor.                                          */
  12. /*                                                                    */
  13. /* Usage:        Select this macro from the Macro List (on the Macro  */
  14. /*               menu), or run it from the macro picklist <shift f12> */
  15. /* ------------------------------------------------------------------ */
  16.  
  17.   // compile time macros and function definitions
  18.   include bootpath "define.aml"
  19.  
  20.   // create a data buffer with all the keynames
  21.   databuf "keynames"
  22.     "<alt '>"
  23.     "<alt ,>"
  24.     "<alt ->"
  25.     "<alt .>"
  26.     "<alt />"
  27.     "<alt 0>"
  28.     "<alt 1>"
  29.     "<alt 2>"
  30.     "<alt 3>"
  31.     "<alt 4>"
  32.     "<alt 5>"
  33.     "<alt 6>"
  34.     "<alt 7>"
  35.     "<alt 8>"
  36.     "<alt 9>"
  37.     "<alt ;>"
  38.     "<alt =>"
  39.     "<alt a>"
  40.     "<alt b>"
  41.     "<alt backspace>"
  42.     "<alt c>"
  43.     "<alt d>"
  44.     "<alt del>"
  45.     "<alt down>"
  46.     "<alt e>"
  47.     "<alt end>"
  48.     "<alt enter>"
  49.     "<alt esc>"
  50.     "<alt f10>"
  51.     "<alt f11>"
  52.     "<alt f12>"
  53.     "<alt f1>"
  54.     "<alt f2>"
  55.     "<alt f3>"
  56.     "<alt f4>"
  57.     "<alt f5>"
  58.     "<alt f6>"
  59.     "<alt f7>"
  60.     "<alt f8>"
  61.     "<alt f9>"
  62.     "<alt f>"
  63.     "<alt g>"
  64.     "<alt grey*>"
  65.     "<alt grey+>"
  66.     "<alt grey->"
  67.     "<alt grey/>"
  68.     "<alt greyenter>"
  69.     "<alt h>"
  70.     "<alt home>"
  71.     "<alt i>"
  72.     "<alt ins>"
  73.     "<alt j>"
  74.     "<alt k>"
  75.     "<alt l>"
  76.     "<alt left>"
  77.     "<alt m>"
  78.     "<alt n>"
  79.     "<alt o>"
  80.     "<alt p>"
  81.     "<alt pgdn>"
  82.     "<alt pgup>"
  83.     "<alt q>"
  84.     "<alt r>"
  85.     "<alt right>"
  86.     "<alt s>"
  87.     "<alt t>"
  88.     "<alt tab>"
  89.     "<alt u>"
  90.     "<alt up>"
  91.     "<alt v>"
  92.     "<alt w>"
  93.     "<alt x>"
  94.     "<alt y>"
  95.     "<alt z>"
  96.     "<alt [>"
  97.     "<alt \\>"
  98.     "<alt ]>"
  99.     "<alt `>"
  100.     "<backspace>"
  101.     "<center>"
  102.     "<char>"
  103.     "<ctrl ->"
  104.     "<ctrl 2>"
  105.     "<ctrl 6>"
  106.     "<ctrl a>"
  107.     "<ctrl b>"
  108.     "<ctrl backspace>"
  109.     "<ctrl c>"
  110.     "<ctrl center>"
  111.     "<ctrl d>"
  112.     "<ctrl del>"
  113.     "<ctrl down>"
  114.     "<ctrl e>"
  115.     "<ctrl end>"
  116.     "<ctrl enter>"
  117.     "<ctrl f10>"
  118.     "<ctrl f11>"
  119.     "<ctrl f12>"
  120.     "<ctrl f1>"
  121.     "<ctrl f2>"
  122.     "<ctrl f3>"
  123.     "<ctrl f4>"
  124.     "<ctrl f5>"
  125.     "<ctrl f6>"
  126.     "<ctrl f7>"
  127.     "<ctrl f8>"
  128.     "<ctrl f9>"
  129.     "<ctrl f>"
  130.     "<ctrl g>"
  131.     "<ctrl grey*>"
  132.     "<ctrl grey+>"
  133.     "<ctrl grey->"
  134.     "<ctrl grey/>"
  135.     "<ctrl greyenter>"
  136.     "<ctrl h>"
  137.     "<ctrl home>"
  138.     "<ctrl i>"
  139.     "<ctrl ins>"
  140.     "<ctrl j>"
  141.     "<ctrl k>"
  142.     "<ctrl l>"
  143.     "<ctrl left>"
  144.     "<ctrl m>"
  145.     "<ctrl n>"
  146.     "<ctrl o>"
  147.     "<ctrl p>"
  148.     "<ctrl pgdn>"
  149.     "<ctrl pgup>"
  150.     "<ctrl prtsc>"
  151.     "<ctrl q>"
  152.     "<ctrl r>"
  153.     "<ctrl right>"
  154.     "<ctrl s>"
  155.     "<ctrl t>"
  156.     "<ctrl tab>"
  157.     "<ctrl u>"
  158.     "<ctrl up>"
  159.     "<ctrl v>"
  160.     "<ctrl w>"
  161.     "<ctrl x>"
  162.     "<ctrl y>"
  163.     "<ctrl z>"
  164.     "<ctrl [>"
  165.     "<ctrl \\>"
  166.     "<ctrl ]>"
  167.     "<del>"
  168.     "<down>"
  169.     "<end>"
  170.     "<enter>"
  171.     "<esc>"
  172.     "<f10>"
  173.     "<f11>"
  174.     "<f12>"
  175.     "<f1>"
  176.     "<f2>"
  177.     "<f3>"
  178.     "<f4>"
  179.     "<f5>"
  180.     "<f6>"
  181.     "<f7>"
  182.     "<f8>"
  183.     "<f9>"
  184.     "<grey*>"
  185.     "<grey+>"
  186.     "<grey->"
  187.     "<greyenter>"
  188.     "<home>"
  189.     "<ins>"
  190.     "<left>"
  191.     "<otherkey>"
  192.     "<pgdn>"
  193.     "<pgup>"
  194.     "<right>"
  195.     "<shift center>"
  196.     "<shift del>"
  197.     "<shift down>"
  198.     "<shift end>"
  199.     "<shift f10>"
  200.     "<shift f11>"
  201.     "<shift f12>"
  202.     "<shift f1>"
  203.     "<shift f2>"
  204.     "<shift f3>"
  205.     "<shift f4>"
  206.     "<shift f5>"
  207.     "<shift f6>"
  208.     "<shift f7>"
  209.     "<shift f8>"
  210.     "<shift f9>"
  211.     "<shift home>"
  212.     "<shift ins>"
  213.     "<shift left>"
  214.     "<shift pgdn>"
  215.     "<shift pgup>"
  216.     "<shift right>"
  217.     "<shift tab>"
  218.     "<shift up>"
  219.     "<shiftkey>"
  220.     "<tab>"
  221.     "<up>"
  222.   end
  223.  
  224.   // get the window event object
  225.   window_object = getwinobj
  226.  
  227.   // do for all lines in the data buffer
  228.   repeat
  229.     // check for the key function in the current event object hierarchy
  230.     if function? (gettext) window_object then
  231.       ovltext "Assigned" 19
  232.     end
  233.   until not down
  234.  
  235.   // display the buffer in a popup menu and get the key selected
  236.   keystr = popup (getcurrbuf) window_object + " window keys" 26
  237.  
  238.   // destroy the key data buffer
  239.   destroybuf
  240.  
  241.   // if a key string was selected, enter it at the cursor
  242.   if keystr then
  243.     // if assigned, then go to the keydef in KBD.AML
  244.     if keystr [0] <> '>' then
  245.       keystr = keystr [1 : pos '>' keystr 'r']
  246.       open (bootpath "KBD.AML")
  247.       if find keystr 'g' then
  248.         send "onfound" (sizeof keystr)
  249.       else
  250.         gotopos 1 1
  251.       end
  252.     else
  253.       // if not assigned, then write keystr at the cursor
  254.       send "write" keystr
  255.     end
  256.   end
  257.  
  258.