home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional Developers Kit 1992 November / Disc01 / Disc01.mdf / prodtool / epm / e_macros / stdkeys.e < prev    next >
Encoding:
Text File  |  1992-08-25  |  55.7 KB  |  1,985 lines

  1. define
  2. compile if EVERSION < 5
  3.    NOT_CMD_STATE = '& not command_state()'
  4. compile else
  5.    NOT_CMD_STATE = ' '
  6. compile endif
  7.  
  8. definit
  9.    universal blockreflowflag
  10. compile if defined(HIGHLIGHT_COLOR)
  11.    universal search_len
  12. compile endif
  13. compile if EVERSION < 5
  14.    universal inKstring
  15.    inKstring=0
  16. compile endif
  17.    blockreflowflag=0
  18. compile if defined(HIGHLIGHT_COLOR)
  19.    search_len = 5     -- Initialize to anything, to prevent possible "Invalid number argument"
  20. compile endif
  21.  
  22. compile if WANT_CUA_MARKING & EPM
  23. defkeys edit_keys new clear
  24.  
  25. def otherkeys =
  26.    k = lastkey()
  27.    call process_key(k)
  28.  
  29. defproc process_key(k)
  30.  compile if WANT_CUA_MARKING = 'SWITCH'
  31.    universal CUA_marking_switch
  32.  compile endif
  33.    if length(k)=1 & k<>\0 then
  34.       i_s = insert_state()
  35.  compile if WANT_CUA_MARKING = 'SWITCH'
  36.       if CUA_marking_switch then
  37.  compile endif
  38.          had_mark = process_mark_like_cua()
  39.          if not i_s & had_mark then
  40.             insert_toggle  -- Turn on insert mode because the key should replace
  41.          endif             -- the mark, not the character after the mark.
  42.  compile if WANT_CUA_MARKING = 'SWITCH'
  43.       else
  44.          had_mark = 0  -- set to 0 so we don't toggle insert state later
  45.       endif
  46.  compile endif
  47.       keyin k
  48.       if not i_s & had_mark then
  49.          insert_toggle
  50.       endif
  51.    endif
  52.  
  53. defproc process_mark_like_cua()
  54.    if marktype() then
  55.       getmark firstline,lastline,firstcol,lastcol,markfileid
  56.       getfileid fileid
  57.       if fileid<>markfileid then
  58.          sayerror MARKED_OTHER__MSG
  59.          unmark
  60.       elseif not check_mark_on_screen() then
  61.          sayerror MARKED_OFFSCREEN__MSG
  62.          unmark
  63.       else
  64. compile if WANT_DM_BUFFER
  65.          'Copy2DMBuff'     -- see clipbrd.e for details
  66. compile endif  -- WANT_DM_BUFFER
  67.          firstline; .col=firstcol
  68. compile if EVERSION >= '5.20'
  69.          undoaction 1, junk                -- Create a new state
  70. compile endif
  71.          call pdelete_mark()
  72.          'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  73.          return 1
  74.       endif
  75.    endif
  76.  
  77. defproc shifted
  78.    ks = getkeystate(VK_SHIFT)
  79.    return ks<>3 & ks<>4
  80.  
  81. compile if EVERSION < 5.50
  82. define CHARG_MARK = 'CHAR'
  83. compile else                -- New mark type
  84. define CHARG_MARK = 'CHARG'
  85. compile endif
  86.  
  87. defproc extend_mark(startline, startcol, forward)
  88. ;compile if WANT_CUA_MARKING = 'SWITCH'
  89. ;  universal CUA_marking_switch
  90. ;  if not CUA_marking_switch then return; endif
  91. ;compile endif
  92.    if marktype()='LINE' | marktype()='BLOCK' then return; endif
  93.    getfileid curfileid
  94.    if not marktype() then
  95. compile if EVERSION < 5.50  -- Forwards and backwards acts differently
  96.       call pset_mark(startline, .line, startcol-(not forward), .col-forward, CHARG_MARK, curfileid)
  97. compile else  -- CHARG handles the differences.
  98.       call pset_mark(startline, .line, startcol, .col, CHARG_MARK, curfileid)
  99. compile endif
  100.       return
  101.    endif
  102. compile if EVERSION < 5.50
  103.    getmark firstline,lastline,firstcol,lastcol,markfileid
  104. compile else
  105.    getmarkg firstline,lastline,firstcol,lastcol,markfileid
  106. compile endif
  107.    if markfileid<>curfileid then  -- If mark was in a different file, treat like no mark was set.
  108. compile if EVERSION < 5.50  -- Forwards and backwards acts differently
  109.       call pset_mark(startline, .line, startcol-(not forward), .col-forward, CHARG_MARK, curfileid)
  110. compile else  -- CHARG handles the differences.
  111.       call pset_mark(startline, .line, startcol, .col, CHARG_MARK, curfileid)
  112. compile endif
  113.       return
  114.    endif
  115.    lk = lastkey(0)
  116.    if (lk=s_up & .line=firstline-1) | (lk=s_down & .line=firstline+1) then
  117.       if length(textline(firstline)) < .col then
  118.          firstcol = .col
  119.       endif
  120.    endif
  121.    if startline>firstline | ((startline=firstline) & (startcol > firstcol)) then  -- at end of mark
  122.       if not forward then
  123.          if firstline=.line & firstcol=.col then unmark; return; endif
  124.       endif
  125. compile if EVERSION < '5.50'
  126.       call pset_mark(firstline, .line, firstcol, .col-1, CHARG_MARK, curfileid)
  127. compile else
  128.       call pset_mark(firstline, .line, firstcol, .col, CHARG_MARK, curfileid)
  129. compile endif
  130.    else                                                         -- at beginning of mark
  131.       if forward then
  132.          if lastline=.line & lastcol=.col-1 then unmark; return; endif
  133.       endif
  134.       call pset_mark(lastline, .line, lastcol, .col, CHARG_MARK, curfileid)
  135.    endif
  136.  
  137. ; c_home, c_end, c_left & c_right do different things if the shift key is depressed.
  138. ; The logic is extracted here mainly due to the complexity of the COMPILE IF's
  139. defproc begin_shift(var startline, var startcol, var shift_flag)
  140.  compile if WANT_CUA_MARKING = 'SWITCH'
  141.    universal CUA_marking_switch
  142.  compile endif
  143.    shift_flag = shifted()
  144.  compile if WANT_CUA_MARKING = 'SWITCH'
  145.    if shift_flag or not CUA_marking_switch then
  146.  compile else
  147.    if shift_flag then
  148.  compile endif
  149.       startline = .line; startcol = .col
  150.    else
  151.       unmark
  152.    endif
  153.  
  154. defproc end_shift(startline, startcol, shift_flag, forward_flag)
  155.  compile if WANT_CUA_MARKING = 'SWITCH'
  156.    universal CUA_marking_switch
  157.    if shift_flag & CUA_marking_switch then
  158.  compile else
  159.    if shift_flag then
  160.  compile endif
  161.       call extend_mark(startline, startcol, forward_flag)
  162.    endif
  163. compile else  -- WANT_CUA_MARKING & EPM
  164. defkeys edit_keys new
  165. compile endif  -- WANT_CUA_MARKING & EPM
  166.  
  167. compile if EVERSION < 5
  168. def entry=
  169. compile endif
  170.  
  171. ; Real keys, in alphabetical order.
  172. ; See end of this file for a list of keys unused in standard E.
  173.  
  174. def a_0=    /* same as Alt-Equal, for sake of German keyboards */
  175.    'dolines'
  176.  
  177. ; We now distribute a standard front end for the DIR command, which redirects
  178. ; the output to a file named ".dos dir <dirspec>".  The third line should be
  179. ; "Directory of <dirname>".  If so, we use it.  If not, we use DIRSPEC from the
  180. ; .filename instead, but note that the latter might contain wildcards.
  181. def a_1= /* edit filename on current text line */
  182.    getline line
  183.    parse value .filename with word1 word2 word3 .
  184.    if upcase(word1 word2) = '.DOS DIR' then
  185.       call psave_pos(save_pos)
  186. compile if EVERSION >= '4.12'
  187.       getsearch oldsearch
  188. compile endif
  189.       'xcom l /'DIRECTORYOF_STRING'/c-'
  190.       if not rc then
  191.          getline word3
  192.          parse value word3 with . . word3 .
  193.       endif
  194. compile if EVERSION >= '4.12'
  195.       setsearch oldsearch
  196. compile endif
  197.       call prestore_pos(save_pos)
  198. compile if not E3  -- DOS (box) doesn't see new-format DIR listing
  199.       filename=substr(line,41)                 -- Support HPFS.  FAT dir's end at 40
  200.       if filename='' then                      -- Must be FAT.
  201. compile endif
  202.          filename=strip(substr(line,1,8))
  203.          word2=strip(substr(line,10,3))
  204.          if word2<>'' then filename=filename'.'word2; endif
  205. compile if not E3  -- DOS (box) doesn't see new-format DIR listing
  206.       endif
  207. compile endif
  208.       name=word3 ||                            -- Start with the path.
  209. compile if EVERSION >= '5.17'
  210.            leftstr('\',                        -- Append a '\', but only if path
  211.                    '\'<>rightstr(word3,1)) ||  -- doesn't end with one.
  212. compile else
  213.            substr('\', 1,                      -- Append a '\', but only if path
  214.                   '\'<>substr(word3,length(word3),1)) ||  -- doesn't end with one.
  215. compile endif
  216.            filename                            -- Finally, the filename
  217.       if pos('<DIR>',line) then
  218.          'dir 'name
  219.       else
  220.          'e 'name
  221.       endif
  222.    else
  223. compile if not E3
  224.       parse value line with filename '(' linenum ':' col ')'
  225.       if col <> '' then  -- CSet/2 error output
  226.          'e 'filename
  227.          if pos(')', linenum) then  -- No, some other compiler
  228.             parse value 1 linenum with col linenum ')'
  229.          endif
  230.          linenum
  231.          .col = col
  232.       else
  233. compile endif
  234.          'e 'line
  235. compile if not E3
  236.       endif
  237. compile endif
  238.    endif
  239.  
  240. compile if WANT_WINDOWS
  241. def a_4=call psplit4()            -- routine defined in WINDOW.E
  242. compile endif
  243.  
  244. def a_a=
  245. compile if WANT_CHAR_OPS
  246.    call pcommon_adjust_overlay('A')
  247. compile else
  248.    adjustblock
  249. compile endif
  250.  
  251. def a_b
  252.    markblock
  253. compile if EVERSION >= 5
  254.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  255. compile endif
  256.  
  257. def a_c=
  258. compile if EPM
  259.    if marktype() then
  260. compile endif
  261.       call pcopy_mark()
  262. compile if EPM
  263.    else                 /* If no mark, look to in Shared Text buffer */
  264.       'GetSharBuff'     /* see clipbrd.e for details                 */
  265.    endif
  266. compile endif
  267.  
  268. def a_d=
  269. compile if WANT_DM_BUFFER
  270.    'Copy2DMBuff'     -- see clipbrd.e for details
  271. compile endif
  272.    call pdelete_mark()
  273. compile if EVERSION > 5
  274.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  275. compile endif
  276.  
  277. def a_e= call pend_mark()
  278.  
  279. def a_equal=
  280.    'dolines'   -- Code is a separate command in STDCMDS.E.
  281.  
  282. def a_f= /* Now accepts key from macro. */
  283.    call checkmark()
  284. compile if EVERSION < 5
  285.    k=mgetkey("Type a character, or Esc to cancel.")
  286.    if length(k)>1 then           -- Do something with extended keys.
  287.       if     k=esc      then ;   -- Let user abort w/o Ctrl-break.
  288.       elseif k=padstar  then k='*'
  289.       elseif k=padplus  then k='+'
  290.       elseif k=padminus then k='-'
  291.       else   k=substr(k,2,1)      endif
  292.    endif
  293.    if k<>esc then call pfill_mark(k); endif
  294. compile else
  295.    call pfill_mark()
  296. compile endif
  297.  
  298. def a_f1= keyin '║ ╠ ╔ ╚ ╩ ═ ╦ ╝ ╗ ╣ ╬ │ ├ ┌ └ ┴ ─ ┬ ┘ ┐ ┤ ┼ █ ▓ ▒ ░'
  299.  
  300. def a_f7,c_F7=   -- Can't use the old A_F7 in EPM.  PM uses it as an accelerator key.
  301.    shift_left
  302. compile if SHIFT_BLOCK_ONLY
  303.    if marktype()='BLOCK' then  -- code by Bob Langer
  304.       getmark fl,ll,fc,lc,fid
  305.       call pset_mark(fl,ll,lc,MAXCOL,'BLOCK',fid)
  306.       shift_right
  307.       call pset_mark(fl,ll,fc,lc,'BLOCK',fid)
  308.    endif
  309. compile endif
  310.  
  311. def a_f8,c_F8=   -- Can't use the old A_F8 in EPM.  PM uses it as an accelerator key.
  312. compile if SHIFT_BLOCK_ONLY
  313.    if marktype()='BLOCK' then  -- code by Bob Langer
  314.       getmark fl,ll,fc,lc,fid
  315.       call pset_mark(fl,ll,lc,MAXCOL,'BLOCK',fid)
  316.       shift_left
  317.       call pset_mark(fl,ll,fc,lc,'BLOCK',fid)
  318.    endif
  319. compile endif
  320.    shift_right
  321.  
  322. compile if EVERSION < 5
  323.  compile if EVERSION < '4.10'          -- Early E doesn't support enh. kbd.
  324. def a_f10,c_P= call pprevfile()       -- routine defined in WINDOW.E
  325.  compile else
  326. def a_f10,F11,c_P= call pprevfile()       -- routine defined in WINDOW.E
  327.  compile endif
  328. compile else
  329. /* We can't use a_f10 for previous file any more, PM uses that key. */
  330. /* I like F11 and F12 to go back and forth.                         */
  331. def a_f10,F11,c_P=  -- a_F10 is usual E default; F11 for enh. kbd, c_P for EPM.
  332.    prevfile
  333. compile endif
  334.  
  335. def a_j=
  336.    call joinlines()
  337.  
  338. def a_l=
  339.    mark_line
  340. compile if EVERSION >= 5
  341.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  342. compile endif
  343.  
  344. def a_m=call pmove_mark()
  345.  
  346. def a_minus =
  347.  compile if EOS2
  348.    display 0
  349.  compile endif
  350.  compile if EVERSION < '5.50'
  351.    sayat '', .cursory, .cursorx, WHITE + REDB + BLINK, 1
  352.  compile else
  353.    circleit 2, .line, .col-1, .col+1, WHITE + REDB + BLINK
  354.  compile endif
  355.  compile if EPM & EVERSION < '5.50'
  356.    call dynalink('DOSCALLS', '#32', atol_swap(1000))  -- 1 second DOSSLEEP
  357.    refresh
  358.  compile endif
  359.  compile if EOS2
  360.    k=getkey()
  361.    display 1
  362.    executekey k
  363.  compile endif
  364.  
  365. def a_n=  /* Type the full name of the current file. */
  366.   keyin .filename
  367.  
  368. def a_o=
  369. compile if EPM
  370.    if marktype() then
  371. compile endif
  372. compile if WANT_CHAR_OPS
  373.       call pcommon_adjust_overlay('O')
  374. compile else
  375.       overlay_block
  376. compile endif
  377. compile if EPM
  378.    else                 /* If no mark, look to in Shared Text buffer */
  379.       'GetSharBuff O'   /* see clipbrd.e for details                 */
  380.    endif
  381. compile endif
  382.  
  383. def a_p=
  384.    /* Protect the user from accidentally reflowing a marked  */
  385.    /* area not in the current file, and give a good message. */
  386.    mt = marktype()
  387.    if mt='BLOCK' or mt='LINE' then
  388.       getmark firstline,lastline,firstcol,lastcol,markfileid
  389.       getfileid fileid
  390.       if fileid<>markfileid then
  391.          sayerror CANT_REFLOW__MSG'  'OTHER_FILE_MARKED__MSG
  392.          return
  393.       endif
  394.    endif
  395.  
  396.    if mt then
  397.       if not check_mark_on_screen() then
  398. compile if EVERSION < 5
  399.          do while testkey()/==''; call getkey(); end
  400.          sayerror MARK_OFF_SCRN_YN__MSG
  401.          loop
  402.             ch=upcase(getkey())
  403.             if ch=YES_CHAR then sayerror 0; leave; endif
  404.             if ch=NO_CHAR or ch=esc then sayerror 0; stop; endif
  405.          endloop
  406. compile else
  407.          sayerror MARK_OFF_SCREEN__MSG
  408.          stop
  409. compile endif
  410.       endif
  411.    endif
  412.  
  413.    if mt='BLOCK' then
  414.       'box r'
  415.    elseif mt='CHAR' then
  416.       sayerror WRONG_MARK__MSG
  417.    elseif mt='LINE' then
  418.       reflow
  419.    elseif .line then
  420.       getline line
  421.       if line<>'' then  -- If currently on a blank line, don't reflow.
  422.          oldcursory=.cursory;oldcursorx=.cursorx; oldline=.line;oldcol=.col;
  423.          unmark;mark_line
  424.          call pfind_blank_line()
  425.          -- Ver 3.11:  slightly revised test works better with GML sensitivity.
  426.          if .line<>oldline then
  427.             up
  428.          else
  429.             bottom
  430.          endif
  431.          mark_line
  432.          reflow
  433.  
  434.         compile if REFLOW_LIKE_PE   /* position on next paragraph (like PE) */
  435.          down                       /* Thanks to Doug Short. */
  436.          for i=.line+1 to .last
  437.             getline line,i
  438.             if line<>'' then i; leave; endif
  439.          endfor
  440.         compile else
  441.          /* or like old E */
  442.          getmark firstline,lastline
  443.          firstline
  444.          .cursory=oldcursory;.cursorx=oldcursorx; oldline;.col=oldcol
  445.         compile endif
  446.          unmark
  447.       endif
  448.    endif
  449.  
  450. definit                         -- Variable is null if alt_R is not active.
  451.    universal alt_R_active       -- For E3/EOS2, it's 1 if alt_R is active.
  452.    alt_R_active = ''            -- For EPM, it's set to querycontrol(messageline).
  453.  
  454. def a_r=
  455.    universal alt_R_active,tempofid
  456. compile if EPM
  457.    universal alt_R_space
  458. compile endif
  459.  
  460.    if alt_R_active<>'' then
  461. compile if EPM
  462.       call pblock_reflow(1,alt_R_space,tempofid)     -- Complete the reflow.
  463.  compile if EVERSION < '5.21'
  464.       .messageline=''                        -- Turn off the message.
  465.  compile else
  466.        'setmessageline '\0
  467.  compile endif
  468.       'togglecontrol 8 'alt_R_active         -- Restore status of messageline.
  469.       alt_R_active = ''
  470.       return
  471. compile else
  472.       activatefile tempofid                  -- Release tempo
  473.       .modify=0
  474.       'xcom q'
  475. compile endif
  476.    endif
  477.    if pblock_reflow(0,alt_R_space,tempofid) then
  478.       sayerror PBLOCK_ERROR__MSG      /* HurleyJ */
  479.       return
  480.    endif
  481. ;  if marktype() <> 'BLOCK' then
  482.       unmark
  483. ;  endif
  484. compile if EPM
  485.  compile if EVERSION >= '5.53'
  486.    alt_R_active = queryframecontrol(2)         -- Remember if messageline on or off
  487.    'toggleframe 2 1'                    -- Force it on
  488.  compile else
  489.    alt_R_active = querycontrol(8)         -- Remember if messageline on or off
  490.    'togglecontrol 8 1'                    -- Force it on
  491.  compile endif
  492.  compile if EVERSION < '5.21'
  493.    .messageline = BLOCK_REFLOW__MSG
  494.  compile else
  495.    'setmessageline BlockReflow: Mark the new block size with Alt-B; press Alt-R again (Esc cancels)'
  496.  compile endif
  497. compile else
  498.    alt_R_active = 1
  499.    sayerror BLOCK_REFLOW__MSG
  500.    loop
  501.       k=getkey()
  502.       if k==a_r then  /* Alt-R ? */
  503.          call pblock_reflow(1,alt_R_space,tempofid)
  504.          leave
  505.       endif
  506.       if k==esc then  /* Esc ? */
  507.          /* release tempo */
  508.          activatefile tempofid
  509.          .modify=0
  510.          'xcom q'
  511.          unmark
  512.          sayerror NOFLOW__MSG
  513.          leave
  514.       endif
  515.       executekey k
  516.    endloop
  517.    alt_R_active = ''
  518. compile endif
  519.  
  520. def a_s=
  521.    call splitlines()
  522.  
  523. def a_t = call pcenter_mark()
  524.  
  525. def a_u=
  526.    unmark
  527. compile if EVERSION > 5
  528.    'ClearSharBuff'       /* Remove Content in EPM shared text buffer */
  529. compile endif
  530.  
  531. def a_w = call pmark_word()
  532.  
  533. ;  EPM:  Haven't yet figured out a way to do Alt-X=escape.  It used a getkey().
  534. compile if EVERSION < 5
  535. def a_x=escape
  536. compile endif
  537.  
  538. def a_y= call pbegin_mark()
  539.  
  540. compile if WANT_CHAR_OPS
  541. def a_z=mark_char
  542.  compile if EVERSION > 5
  543.    'Copy2SharBuff'       /* Copy mark to shared text buffer */
  544.  compile endif
  545. compile endif
  546.  
  547. compile if EVERSION < 5
  548. def backspace=
  549. compile else
  550. def backspace, s_backspace =
  551. compile endif
  552.  compile if WANT_STREAM_MODE = 'SWITCH'
  553.    universal stream_mode
  554.  compile endif
  555.  compile if WANT_CUA_MARKING = 'SWITCH'
  556.    universal CUA_marking_switch
  557.    if CUA_marking_switch then
  558.  compile endif
  559.  compile if WANT_CUA_MARKING
  560.   compile if EVERSION < 5
  561.    if command_state() then rubout; return; endif
  562.   compile endif
  563.    if process_mark_like_cua() then return; endif
  564.  compile endif
  565.  compile if WANT_CUA_MARKING = 'SWITCH'
  566.    endif
  567.  compile endif
  568. compile if WANT_STREAM_MODE
  569.  compile if WANT_STREAM_MODE = 'SWITCH'
  570.    if .col=1 & .line>1 & stream_mode $NOT_CMD_STATE then
  571.  compile else
  572.    if .col=1 & .line>1 $NOT_CMD_STATE then
  573.  compile endif
  574.       up
  575.       l=length(textline(.line))
  576.       join
  577.       .col=l+1
  578.    else
  579. compile endif
  580. compile if EVERSION >= '5.50'
  581.       old_level = .levelofattributesupport
  582.       if old_level & not (old_level%2 - 2*(old_level%4)) then
  583.          .levelofattributesupport = .levelofattributesupport + 2
  584.          .cursoroffset = -300
  585.       endif
  586. compile endif
  587.       rubout
  588. compile if EVERSION >= '5.50'
  589.       .levelofattributesupport = old_level
  590. compile endif
  591. compile if WANT_STREAM_MODE
  592.    endif
  593. compile endif
  594.  
  595. def c_2 = keyin \0                  -- C_2 enters a null.
  596. def c_6 = keyin \170                -- C_6 enters a "not" sign
  597. compile if EVERSION >= '5.50'
  598. def c_9 = keyin '{'
  599. def c_0 = keyin '}'
  600. compile endif
  601.  
  602. compile if WANT_WINDOWS
  603. def c_a= call pnextwindowstyle()  -- routine defined in WINDOW.E
  604. compile endif
  605.  
  606. compile if WANT_BOOKMARKS
  607. def c_B = 'listmark'
  608. compile endif
  609.  
  610. def c_backspace=
  611. compile if EVERSION >= '5.50'
  612.    if .levelofattributesupport then
  613.       if (.line==.last and .line<>1) then       -- this is the last line
  614.          destinationLine=.line-1                -- and there is a previous line to store attributes on
  615.          getline prevline,DestinationLine
  616.          DestinationCol=length(prevline)+1      -- start search parameters
  617.                                                 -- destination of attributes
  618.          findoffset=-300                        -- start at the begin of the attr list
  619.          findline=.line                         -- of the first char on this line
  620.          findcolumn=1
  621.  
  622.          do forever        -- search until no more attr's (since this is last line)
  623.             FINDCLASS=0          -- 0 is anyclass
  624.             Attribute_action FIND_NEXT_ATTR_SUBOP, findclass, findoffset, findcolumn, findline
  625.             if not findclass or (findline<>.line) then  -- No attribute, or not on this line
  626.                leave
  627.             endif
  628.             query_attribute theclass,thevalue, thepush, findoffset, findcolumn, findline   -- push or pop?
  629.             if not thePush then       -- ..if its a pop attr and ..
  630.                matchClass=theClass
  631.                MatchOffset=FindOffset
  632.                MatchLine=FindLine
  633.                MatchColumn=FindColumn  -- ..and if its match is not on this line or at the destination
  634.                Attribute_Action FIND_MATCH_ATTR_SUBOP, MatchClass, MatchOffset, Matchcolumn, MatchLine
  635.                if ((Matchline==DestinationLine) and (Matchcolumn==destinationcol)) then
  636.                   -- then there is a cancellation of attributes
  637.                   Attribute_action Delete_ATTR_SUBOP, theclass, Findoffset, Findcolumn, Findline
  638.                   Attribute_action Delete_ATTR_SUBOP, Matchclass, Matchoffset, Matchcolumn, Matchline
  639.                elseif (MatchLine<>.line)  then
  640.                   -- .. then move attribute to destination (before attributes which have been scanned so its OK.)
  641.                   -- insert attr at the end of the attr list (offset=0)
  642.                   Insert_Attribute theclass, thevalue, 0, 0, DestinationCol, DestinationLine
  643.                   Attribute_action Delete_ATTR_SUBOP, theclass, Findoffset, Findcolumn, Findline
  644.                endif -- end if attr is on line or at destination
  645.             endif -- end if found attr is a pop
  646.          enddo  -- end search for attr's
  647.       elseif .line < .last then  -- put the attributes after the line since there may not
  648.                                  -- be a line before this line (as when .line==1)
  649.          DestinationCol=1
  650.          DestinationLine=.line+1         -- error point since this puts attr's after last line if .line=.last
  651.          findoffset=0                    -- cant make it .line-1 cause then present attributes there become
  652.          findline=.line                  -- after these attributes which is wrong
  653.          findcolumn=MAXCOL
  654.  
  655.          do forever
  656.             FINDCLASS=0
  657.             Attribute_action FIND_PREV_ATTR_SUBOP, findclass, findoffset, findcolumn, findline
  658.             if not findclass or (findline<>.line) then  -- No attribute, or not on this line
  659.                leave
  660.             endif
  661.              /* Move Attribute */
  662.             query_attribute theclass,thevalue, thepush, findoffset, findcolumn, findline
  663.             -- only move push/pop model attributes (tags are just deleted)
  664.             if ((thepush==0) or (thepush==1)) then
  665.                -- move attribute to destination, if cancellation delete both attributes
  666.                FastMoveAttrToBeg(theclass, thevalue, thepush, DestinationCol, DestinationLine, findcolumn, findline, findoffset)
  667.                findoffset=findoffset+1  -- since the attr rec was deleted and all attr rec's were shifted to fill the vacancy
  668.                                         -- and search is exclusive
  669.             endif
  670.          enddo
  671.       endif -- endif .line=.last and .line=1
  672.    endif -- .levelofattributesupport
  673. compile endif
  674.    delete
  675. compile if EVERSION < 5
  676.    if command_state() then
  677.       begin_line
  678.    endif
  679. compile endif
  680.  
  681. def c_c=
  682. compile if EVERSION < 5
  683.   right
  684. compile else
  685.   'c'    -- EPM c_c is used for change next
  686. compile endif
  687.  
  688. ; Ctrl-D = word delete, thanks to Bill Brantley.
  689. def c_d =  /* delete from cursor until beginning of next word, UNDOable */
  690. compile if EVERSION < 5
  691.    if command_state() then
  692.       getcommand cmdline, begcur, cmdscrPos
  693.       lenCmdLine=length(cmdline)
  694.       if lenCmdLine >= begcur then
  695.          for i = begcur to lenCmdLine /* delete remainder of word */
  696.             if substr(cmdline,i,1)<>' ' then
  697.                deleteChar
  698.             else
  699.                leave
  700.             endif
  701.          endfor
  702.          for j = i to lenCmdLine /* delete delimiters following word */
  703.             if substr(cmdline,j,1)==' ' then
  704.                deleteChar
  705.             else
  706.                leave
  707.             endif
  708.          endfor
  709.       endif
  710.    else
  711. compile endif
  712.       getline line
  713.       begcur=.col
  714.       lenLine=length(line)
  715.       if lenLine >= begcur then
  716.          for i = begcur to lenLine /* delete remainder of word */
  717.             if substr(Line,i,1)<>' ' then
  718.                deleteChar
  719.             else
  720.                leave
  721.             endif
  722.          endfor
  723.          for j = i to lenLine /* delete delimiters following word */
  724.             if substr(Line,j,1)==' ' then
  725.                deleteChar
  726.             else
  727.                leave
  728.             endif
  729.          endfor
  730.       endif
  731. compile if EVERSION < 5
  732.    endif
  733. compile endif
  734.  
  735. compile if EVERSION >= '4.10'
  736. def c_e, c_del=erase_end_line  -- Ctrl-Del is the PM way.
  737. compile else
  738. def c_e=erase_end_line
  739. compile endif
  740.  
  741. compile if WANT_KEYWORD_HELP
  742. def c_h = 'kwhelp'
  743. compile endif
  744.  
  745. def c_end=
  746.  compile if WANT_STREAM_MODE = 'SWITCH'
  747.    universal stream_mode
  748. compile endif
  749. compile if WANT_CUA_MARKING
  750.    call begin_shift(startline, startcol, shift_flag)
  751. compile endif
  752. compile if WANT_STREAM_MODE = 'SWITCH'
  753.    if stream_mode then
  754. compile endif
  755. compile if WANT_STREAM_MODE
  756.       bottom; endline
  757. compile endif
  758. compile if WANT_STREAM_MODE = 'SWITCH'
  759.    else
  760. compile endif
  761. compile if WANT_STREAM_MODE <> 1
  762.       if .line=.last and .line then endline; endif
  763.       bottom
  764. compile endif
  765. compile if WANT_STREAM_MODE = 'SWITCH'
  766.    endif
  767. compile endif
  768. compile if WANT_CUA_MARKING
  769.    call end_shift(startline, startcol, shift_flag, 1)
  770. compile endif
  771.  
  772. compile if ENHANCED_ENTER_KEYS & C_ENTER_ACTION <> ''  -- define each key separately
  773. ; Nothing - defined below along with ENTER
  774. compile else
  775.  compile if EVERSION >= '4.10'
  776. def c_enter, c_pad_enter=     -- 4.10:  new key for enhanced keyboard
  777.  compile else
  778. def c_enter=
  779.  compile endif
  780.    call my_c_enter()
  781.  compile if E3 and SHOW_MODIFY_METHOD
  782.    call show_modify()
  783.  compile endif
  784. compile endif
  785.  
  786. def c_f=
  787. compile if defined(HIGHLIGHT_COLOR)
  788.    universal search_len
  789.  compile if EOS2
  790.    universal inKstring
  791.  compile endif
  792. compile endif
  793. compile if EVERSION > 5
  794.    sayerror 0
  795. compile endif
  796.    repeat_find       /* find next */
  797. compile if EVERSION < 5
  798.    if not rc then
  799.       cursor_data
  800.  compile if defined(HIGHLIGHT_COLOR)
  801.       refresh
  802.       sayat '', .windowy+.cursory-1,.windowx+.cursorx-1,
  803.             HIGHLIGHT_COLOR, min(search_len, .windowwidth - .cursorx + 1)
  804.   compile if EOS2
  805.       if inKstring <=0 then
  806.          k=getkey()
  807.          executekey k
  808.       endif
  809.   compile endif
  810.  compile endif
  811.    endif
  812. compile elseif defined(HIGHLIGHT_COLOR)
  813.    if not rc then
  814.  compile if EVERSION < '5.50'
  815.       refresh
  816.       sayat '', .cursory, .cursorx, HIGHLIGHT_COLOR, min(search_len, .windowwidth - .cursorx + 1)
  817.  compile else
  818.       circleit 1, .line, .col, .col+search_len-1, HIGHLIGHT_COLOR
  819. ;     refresh
  820.  compile endif
  821.    endif
  822. compile endif
  823.  
  824. def c_f1=
  825. compile if EVERSION < 5
  826.    call init_operation_on_commandline()
  827. compile endif
  828.    call psave_mark(save_mark)
  829.    call pmark_word()
  830.    call puppercase()
  831.    call prestore_mark(save_mark)
  832. compile if EVERSION < 5
  833.    call move_results_to_commandline()
  834. compile endif
  835.  
  836. def c_f2=
  837. compile if EVERSION < 5
  838.    call init_operation_on_commandline()
  839. compile endif
  840.    call psave_mark(save_mark)
  841.    call pmark_word()
  842.    call plowercase()
  843.    call prestore_mark(save_mark)
  844. compile if EVERSION < 5
  845.    call move_results_to_commandline()
  846. compile endif
  847.  
  848. def c_f3= call puppercase()
  849.  
  850. def c_f4= call plowercase()
  851.  
  852. def c_f5=
  853. compile if EVERSION < 5
  854.    call init_operation_on_commandline()
  855. compile endif
  856.    call pbegin_word()
  857. compile if EVERSION < 5
  858.    call move_results_to_commandline()
  859. compile endif
  860.  
  861. def c_f6=
  862. compile if EVERSION < 5
  863.    call init_operation_on_commandline()
  864. compile endif
  865.    call pend_word()
  866. compile if EVERSION < 5
  867.    call move_results_to_commandline()
  868. compile endif
  869.  
  870. compile if EPM
  871. def c_g='ring_more'
  872. compile endif
  873.  
  874. def c_home=
  875. compile if WANT_STREAM_MODE = 'SWITCH'
  876.    universal stream_mode
  877. compile endif
  878. compile if WANT_CUA_MARKING
  879.    call begin_shift(startline, startcol, shift_flag)
  880. compile endif
  881. compile if WANT_STREAM_MODE = 'SWITCH'
  882.    if stream_mode then
  883. compile endif
  884. compile if WANT_STREAM_MODE
  885.       top; begin_line
  886. compile endif
  887. compile if WANT_STREAM_MODE = 'SWITCH'
  888.    else
  889. compile endif
  890. compile if WANT_STREAM_MODE <> 1
  891.       if .line=1 then begin_line endif
  892.       top
  893. compile endif
  894. compile if WANT_STREAM_MODE = 'SWITCH'
  895.    endif
  896. compile endif
  897. compile if WANT_CUA_MARKING
  898.    call end_shift(startline, startcol, shift_flag, 0)
  899. compile endif
  900.  
  901. compile if WANT_WINDOWS
  902. def c_h=call psplith()            -- routine defined in WINDOW.E
  903. compile endif
  904.  
  905. def c_k=      -- Duplicate a line
  906.   getline line
  907.   insertline line,.line+1
  908.  
  909. def c_l =
  910.    if .line then
  911.       getline line
  912. compile if EPM
  913.       'commandline 'line
  914. compile else
  915.       if not command_state() then
  916.          cursor_command
  917.          begin_line;erase_end_line
  918.       endif
  919.       keyin line
  920. compile endif
  921.    endif
  922.  
  923. def c_left=
  924. compile if WANT_STREAM_MODE = 'SWITCH'
  925.    universal stream_mode
  926. compile endif
  927. compile if EVERSION < 5
  928.    call init_operation_on_commandline()
  929. compile endif
  930. compile if WANT_CUA_MARKING
  931.    call begin_shift(startline, startcol, shift_flag)
  932. compile endif
  933. compile if WANT_STREAM_MODE
  934.    if not .line then
  935.       begin_line
  936.  compile if WANT_STREAM_MODE = 'SWITCH'
  937.    elseif .line>1 & .col=max(1,verify(textline(.line),' ')) & stream_mode $NOT_CMD_STATE then
  938.  compile else
  939.    elseif .line>1 & .col=max(1,verify(textline(.line),' ')) $NOT_CMD_STATE then
  940.  compile endif
  941.       up; end_line
  942.    endif
  943. compile endif
  944.    backtab_word
  945. compile if EVERSION < 5
  946.    call move_results_to_commandline()
  947. compile endif
  948. compile if WANT_CUA_MARKING
  949.    call end_shift(startline, startcol, shift_flag, 0)
  950. compile endif
  951.  
  952. ; This C-M definition allows external cut-and-paste utilities to
  953. ; feed text into E via the keyboard stream.  Most such utilities end each line
  954. ; of text with ASCII character 13.  This definition is needed because E
  955. ; distinguishes that as a different key (Ctrl-M) than Enter.
  956. def c_m =
  957.    insert
  958.  
  959. def c_pgup=
  960. compile if WANT_CUA_MARKING
  961.  compile if WANT_CUA_MARKING = 'SWITCH'
  962.    universal CUA_marking_switch
  963.    if CUA_marking_switch then
  964.  compile endif
  965.       unmark
  966.  compile if WANT_CUA_MARKING = 'SWITCH'
  967.    endif
  968.  compile endif
  969. compile endif
  970.    .cursory=1
  971.  
  972. def c_pgdn=
  973. compile if WANT_CUA_MARKING
  974.  compile if WANT_CUA_MARKING = 'SWITCH'
  975.    universal CUA_marking_switch
  976.    if CUA_marking_switch then
  977.  compile endif
  978.       unmark
  979.  compile if WANT_CUA_MARKING = 'SWITCH'
  980.    endif
  981.  compile endif
  982. compile endif
  983.    .cursory=.windowheight
  984.  
  985. compile if EVERSION < 5
  986. /************************************************************/
  987. /* Create a string of keys in Kstring variable.             */
  988. /* All control keys have the same character (X'00') as the  */
  989. /* first character of a two-character string.               */
  990. /*                                                          */
  991. /* The number of keys that may be stored is given by:       */
  992. /*           256 > n + 2*e                                  */
  993. /* where:                                                   */
  994. /*       n are normal data keys (one byte from BIOS)        */
  995. /*       e are extended code keys (two bytes from BIOS)     */
  996. /************************************************************/
  997. def c_r=
  998.    universal Kstring,Kins_state,Kcom_state,inKstring
  999.  
  1000.    inKstring=-1      /* Set recording flag; see defproc mgetkey(). */
  1001.    sayerror CTRL_R__MSG
  1002.    oldKins_state=Kins_state
  1003.    oldKstring   =Kstring
  1004.    oldKcom_state=Kcom_state
  1005.    Kins_state   =insert_state()
  1006.    Kstring      =''
  1007.    Kcom_state   =command_state()
  1008.    Kct=0
  1009.    loop
  1010.       k=getkey()
  1011.       if k==c_r then  /* Ctrl-R ? */
  1012.          sayerror REMEMBERED__MSG
  1013.          leave
  1014.       endif
  1015.       if k==c_t then  /* Ctrl-T ? */
  1016.          leave
  1017.       endif
  1018.       if k==c_c then  /* cancel? */
  1019.          Kstring   =oldKstring
  1020.          Kins_state=oldKins_state
  1021.          Kcom_state=oldKcom_state
  1022.          sayerror CANCELLED__MSG'  'OLD_KEPT__MSG
  1023.          leave
  1024.       endif
  1025.       Kstring=Kstring||k
  1026.       Kct=length(Kstring)
  1027.       executekey k         /* execute AFTER adding to string */
  1028.       if Kct > MAXCOL then
  1029.          sayerror CTRL_R_ABORT__MSG
  1030.          Kstring=oldKstring
  1031.          Kins_state=oldKins_state
  1032.          Kcom_state=oldKcom_state
  1033.          loop
  1034.             k=getkey()
  1035.             if k==esc or k==c_c then leave endif   /* accept either */
  1036.          endloop
  1037.          sayerror OLD_KEPT__MSG
  1038.          leave
  1039.       endif
  1040.    endloop
  1041.    inKstring=0       /* lower state flag */
  1042.    if k==c_t then    /* Was it Ctrl-T? */
  1043.       sayerror 0     /* refresh the function keys */
  1044.       executekey k
  1045.    endif
  1046. compile endif
  1047.  
  1048. compile if EPM
  1049. def c_r
  1050.    -- Query to see if we are already in recording
  1051.    if windowmessage(1,  getpminfo(EPMINFO_EDITCLIENT),
  1052.                     5393,
  1053.                     0,
  1054.                     0)
  1055.    then
  1056.       call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1057.                          5392,
  1058.                          0,
  1059.                          0)
  1060.       sayerror REMEMBERED__MSG
  1061.    else
  1062.       sayerror CTRL_R__MSG
  1063.       call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1064.                          5390,
  1065.                          0,
  1066.                          0)
  1067.    endif
  1068. compile endif
  1069.  
  1070. def c_right=
  1071. compile if WANT_STREAM_MODE = 'SWITCH'
  1072.    universal stream_mode
  1073. compile endif
  1074. compile if EVERSION < 5
  1075.    call init_operation_on_commandline()
  1076. compile endif
  1077. compile if WANT_CUA_MARKING
  1078.    call begin_shift(startline, startcol, shift_flag)
  1079. compile endif
  1080. compile if WANT_STREAM_MODE
  1081.    getline line
  1082.  compile if WANT_STREAM_MODE = 'SWITCH'
  1083.    if not .line | lastpos(' ',line)<.col & .line<.last & stream_mode $NOT_CMD_STATE then
  1084.  compile else
  1085.    if not .line | lastpos(' ',line)<.col & .line<.last $NOT_CMD_STATE then
  1086.  compile endif
  1087.       down
  1088.       call pfirst_nonblank()
  1089.    else
  1090. compile endif
  1091.       tab_word
  1092. compile if WANT_STREAM_MODE
  1093.    endif
  1094. compile endif
  1095. compile if EVERSION < 5
  1096.    call move_results_to_commandline()
  1097. compile endif
  1098. compile if WANT_CUA_MARKING
  1099.    call end_shift(startline, startcol, shift_flag, 1)
  1100. compile endif
  1101.  
  1102. -- Pop up Search dialog
  1103. compile if EVERSION > 5
  1104. def c_s=
  1105.    'searchdlg'
  1106. compile endif
  1107.  
  1108. compile if EVERSION < 5
  1109. /************************************************************/
  1110. /* Execute the string of keys in Kstring variable.          */
  1111. /* All control keys have the same character (X'00') as the  */
  1112. /* first character of a two-character string                */
  1113. /*                                                          */
  1114. /* The number of keys that may be stored is given by:       */
  1115. /*           256 > n + 2*e                                  */
  1116. /* where:                                                   */
  1117. /*       n are normal data keys (one byte from BIOS)        */
  1118. /*       c are extended code keys (two bytes from BIOS)     */
  1119. /************************************************************/
  1120. def c_t=
  1121.    universal Kstring,Kins_state,Kcom_state,inKstring
  1122.  
  1123.    if Kstring=='' then
  1124.       sayerror NO_CTRL_R__MSG              /* HurleyJ */
  1125.       return
  1126.    endif   /* Has a string been recorded? */
  1127.    if Kins_state/==insert_state()   then  insert_toggle endif
  1128.    if Kcom_state/==command_state() then command_toggle endif
  1129.  
  1130.    inKstring=1    /* Set replaying flag; see defproc mgetkey(). */
  1131.    loop
  1132.       k=substr(Kstring,inKstring,1)
  1133.       ksize=1
  1134.       if k==substr(esc,1,1) then       /* extended key ? */
  1135.          k=substr(Kstring,inKstring,2) /* Yes, 2 bytes for extended key. */
  1136.          ksize=2
  1137.       endif
  1138.       inKstring=inKstring+ksize        /* bump index AFTER execution */
  1139.       executekey k
  1140.       if inKstring > length(Kstring) then leave endif
  1141.    endloop
  1142.    inKstring=0
  1143. compile endif
  1144.  
  1145. compile if EPM
  1146. def c_t
  1147.    call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1148.                       5392,
  1149.                       0,
  1150.                       0)
  1151.    call windowmessage(0,  getpminfo(EPMINFO_EDITCLIENT),
  1152.                       5391,
  1153.                       0,
  1154.                       0)
  1155. compile endif
  1156.  
  1157. compile if EVERSION >= 4
  1158. def c_tab = keyin \9
  1159. compile endif
  1160.  
  1161. compile if WANT_WINDOWS
  1162. def c_v= call psplitv()           -- routine defined in WINDOW.E
  1163. def c_w= call pnextwindow()       -- routine defined in WINDOW.E
  1164. def c_z= call pzoom()             -- routine defined in WINDOW.E
  1165. compile endif
  1166.  
  1167. compile if EPM
  1168. def c_W=
  1169.    if marktype()<>'' then
  1170.       sayerror -279  -- 'Text already marked'
  1171.       return
  1172.    endif
  1173.    if find_token(startcol, endcol) then
  1174.       getfileid fid
  1175.       call pset_mark(.line, .line, startcol, endcol, 'BLOCK', fid)
  1176.    endif
  1177. compile endif
  1178.  
  1179. compile if EVERSION >= '5.50'
  1180. def c_Y = 'fontlist'
  1181. compile endif
  1182.  
  1183. def del=
  1184. compile if WANT_STREAM_MODE = 'SWITCH'
  1185.    universal stream_mode
  1186. compile endif
  1187. compile if WANT_CUA_MARKING & EPM
  1188.  compile if WANT_CUA_MARKING = 'SWITCH'
  1189.    universal CUA_marking_switch
  1190.    if marktype() & CUA_marking_switch then    -- If there's a mark, then
  1191.  compile else
  1192.    if marktype() then    -- If there's a mark, then
  1193.  compile endif
  1194.       if process_mark_like_cua() then return; endif
  1195.    endif
  1196. compile endif
  1197. compile if WANT_STREAM_MODE
  1198.    if .line then
  1199.       l=length(textline(.line))
  1200.    else
  1201.       l=.col    -- make the following IF fail
  1202.    endif
  1203.  compile if WANT_STREAM_MODE = 'SWITCH'
  1204.    if .col>l & stream_mode $NOT_CMD_STATE then
  1205.  compile else
  1206.    if .col>l $NOT_CMD_STATE then
  1207.  compile endif
  1208.       join
  1209.       .col=l+1
  1210.    else
  1211. compile endif  -- WANT_STREAM_MODE
  1212. compile if EVERSION >= '5.50'
  1213.       old_level = .levelofattributesupport
  1214.       if old_level & not (old_level%2 - 2*(old_level%4)) then
  1215.          .levelofattributesupport = .levelofattributesupport + 2
  1216.          .cursoroffset = 0
  1217.       endif
  1218. compile endif
  1219.       delete_char
  1220. compile if EVERSION >= '5.50'
  1221.       .levelofattributesupport = old_level
  1222. compile endif
  1223. compile if WANT_STREAM_MODE
  1224.    endif
  1225. compile endif
  1226.  
  1227. def down=
  1228. compile if WANT_CUA_MARKING
  1229.  compile if WANT_CUA_MARKING = 'SWITCH'
  1230.    universal CUA_marking_switch
  1231.    if CUA_marking_switch then
  1232.  compile endif
  1233.       unmark
  1234.  compile if WANT_CUA_MARKING = 'SWITCH'
  1235.    endif
  1236.  compile endif
  1237. compile endif
  1238. compile if WANT_STREAM_MODE
  1239.    call updownkey(1)
  1240. compile else
  1241.    down
  1242. compile endif
  1243.  
  1244. compile if WANT_CUA_MARKING & EPM
  1245. def s_down=
  1246.  compile if WANT_CUA_MARKING = 'SWITCH'
  1247.    universal CUA_marking_switch
  1248.  compile endif
  1249.    startline = .line; startcol = .col
  1250. compile if WANT_STREAM_MODE
  1251.    call updownkey(1)
  1252. compile else
  1253.    down
  1254. compile endif
  1255. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1256. ;  if CUA_marking_switch then
  1257. ;compile endif
  1258.    if startline then call extend_mark(startline, startcol, 1); endif
  1259. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1260. ;  endif
  1261. ;compile endif
  1262. compile endif
  1263.  
  1264. def end=
  1265. compile if WANT_CUA_MARKING
  1266.  compile if WANT_CUA_MARKING = 'SWITCH'
  1267.    universal CUA_marking_switch
  1268.    if CUA_marking_switch then
  1269.  compile endif
  1270.       unmark
  1271.  compile if WANT_CUA_MARKING = 'SWITCH'
  1272.    endif
  1273.  compile endif
  1274. compile endif
  1275.    end_line
  1276.  
  1277. compile if WANT_CUA_MARKING & EPM
  1278. def s_end =
  1279.    startline = .line; startcol = .col
  1280.    end_line
  1281.    call extend_mark(startline, startcol, 1)
  1282. compile endif
  1283.  
  1284. compile if ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''  -- define each key separately
  1285. def enter =
  1286.    universal enterkey
  1287.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1288.    if leftstr(.filename, 15) = ".command_shell_" then
  1289.       shellnum=substr(.filename,16)
  1290.       getline line
  1291.       x = pos('>',line)
  1292.       text = substr(line,x+1)
  1293.       if leftstr(line,5)='epm: ' & x & shellnum & text<>'' then
  1294.          if .line=.last then .col=x+1; erase_end_line; endif
  1295.          'shell_write' shellnum text
  1296.       else
  1297.          call enter_common(enterkey)
  1298.       endif
  1299.    else
  1300.  compile endif
  1301.       call enter_common(enterkey)
  1302.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1303.   endif
  1304.  compile endif
  1305. def a_enter =
  1306.    universal a_enterkey
  1307.    call enter_common(a_enterkey)
  1308. def c_enter =
  1309.    universal c_enterkey
  1310.    call enter_common(c_enterkey)
  1311. def s_enter =
  1312.    universal s_enterkey
  1313.    call enter_common(s_enterkey)
  1314. def padenter =
  1315.    universal padenterkey
  1316.    call enter_common(padenterkey)
  1317. def a_padenter =
  1318.    universal a_padenterkey
  1319.    call enter_common(a_padenterkey)
  1320. def c_padenter =
  1321.    universal c_padenterkey
  1322.    call enter_common(c_padenterkey)
  1323. def s_padenter =
  1324.    universal s_padenterkey
  1325.    call enter_common(s_padenterkey)
  1326. compile else
  1327.  compile if EVERSION >= '4.10'
  1328.   compile if EVERSION < 5
  1329. def enter, pad_enter, a_enter, a_pad_enter=  --4.10: new enhanced keyboard keys
  1330.   compile else
  1331. def enter, pad_enter, a_enter, a_pad_enter, s_enter, s_padenter=
  1332.   compile endif
  1333.  compile else
  1334. def enter=
  1335.  compile endif
  1336.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1337.    if leftstr(.filename, 15) = ".command_shell_" then
  1338.       shellnum=substr(.filename,16)
  1339.       getline line
  1340.       x = pos('>',line)
  1341.       text = substr(line,x+1)
  1342.       if leftstr(line,5)='epm: ' & x & shellnum & text<>'' then
  1343.          if .line=.last then .col=x+1; erase_end_line; endif
  1344.          'shell_write' shellnum text
  1345.       else
  1346.          call my_enter()
  1347.       endif
  1348.    else
  1349.  compile endif
  1350.    call my_enter()
  1351.  compile if E3 and SHOW_MODIFY_METHOD
  1352.    call show_modify()
  1353.  compile endif
  1354.  compile if WANT_EPM_SHELL & EPM_SHELL_PROMPT = '@prompt epm: $p $g'
  1355.   endif
  1356.  compile endif
  1357. compile endif  -- ENHANCED_ENTER_KEYS & ENTER_ACTION <> ''
  1358.  
  1359. compile if not defined(NO_ESCAPE)
  1360.    const NO_ESCAPE = 0
  1361. compile endif
  1362.  
  1363. compile if EVERSION < 5
  1364. def esc=
  1365.    command_toggle
  1366.  compile if E3 and SHOW_MODIFY_METHOD
  1367.    call show_modify()
  1368.  compile endif
  1369. compile else  -- else EPM
  1370.  compile if NO_ESCAPE  -- Blame CUA  :-(
  1371. def esc=
  1372.   compile if TOGGLE_ESCAPE
  1373.    universal ESCAPE_KEY
  1374.   compile endif
  1375.  compile else
  1376. def esc, C_I=
  1377.  compile endif
  1378.    universal alt_R_active
  1379.  
  1380.    sayerror 0
  1381.    if alt_R_active<>'' then
  1382.  compile if EVERSION < '5.21'
  1383.       .messageline=''                        -- Turn off the message.
  1384.  compile else
  1385.        'setmessageline '\0
  1386.  compile endif
  1387.  compile if EVERSION >= '5.53'
  1388.       'toggleframe 2 'alt_R_active         -- Restore status of messageline.
  1389.  compile else
  1390.       'togglecontrol 8 'alt_R_active         -- Restore status of messageline.
  1391.  compile endif
  1392.       alt_R_active = ''
  1393.  compile if NO_ESCAPE
  1394.   compile if TOGGLE_ESCAPE
  1395.    elseif ESCAPE_KEY then
  1396.       'commandline'
  1397.   compile endif
  1398.    endif
  1399. def c_I='commandline'
  1400.  compile else
  1401.    else
  1402.       'commandline'
  1403.    endif
  1404.  compile endif  -- no Escape
  1405. compile endif  -- EPM
  1406.  
  1407. def f1= 'help'
  1408.  
  1409. def f2=
  1410. compile if SMARTSAVE
  1411.    if .modify then           -- Modified since last Save?
  1412.       'Save'                 --   Yes - save it
  1413.    else
  1414.  compile if EPM
  1415.       'commandline Save '
  1416.  compile else
  1417.       if not command_state() then
  1418.          cursor_command
  1419.       endif
  1420.       begin_line;erase_end_line
  1421.       keyin 'Save '
  1422.  compile endif
  1423.       sayerror 'No changes.  Press Enter to Save anyway.'
  1424.    endif
  1425. compile else
  1426.    'Save'
  1427. compile endif
  1428.  
  1429. def f3= 'quit'
  1430.  
  1431. def f4=
  1432. compile if SMARTFILE
  1433.    if .modify then           -- Modified since last Save?
  1434.       'File'                 --   Yes - save it and quit.
  1435.    else
  1436.       'Quit'                 --   No - just quit.
  1437.    endif
  1438. compile else
  1439.    'File'
  1440. compile endif
  1441.  
  1442. compile if EVERSION < 5
  1443. def f7=cursor_command; delete; begin_line; keyin 'Name '
  1444. def f8=cursor_command; delete; begin_line; keyin 'Edit '
  1445. compile else
  1446.                     /* keys by EPM */
  1447. def f5, c_O='OPENDLG'
  1448. def f7='rename'
  1449. def f8=
  1450.  compile if RING_OPTIONAL
  1451.    universal ring_enabled
  1452.    if not ring_enabled then
  1453.       sayerror NO_RING__MSG
  1454.       return
  1455.    endif
  1456.  compile endif
  1457.    'OPENDLG EDIT'
  1458. compile endif
  1459.  
  1460. compile if EVERSION < 5
  1461. def f9=undo
  1462. compile else
  1463. def f9, a_backspace = undo
  1464. compile endif
  1465.  
  1466.  
  1467. compile if EVERSION < 5
  1468.  compile if EVERSION < '4.10'          -- Early E doesn't support enh. kbd.
  1469. def f10,c_N= call pnextfile()             -- routine defined in WINDOW.E
  1470.  compile else
  1471. def f10,f12,c_N= call pnextfile()         -- routine defined in WINDOW.E
  1472.  compile endif
  1473. compile else
  1474. def f10,f12,c_N=   -- F10 is usual E default; F12 for enhanced kbd, c_N for EPM.
  1475.    nextfile
  1476. compile endif
  1477.  
  1478.  
  1479. def home =
  1480. compile if WANT_CUA_MARKING
  1481.  compile if WANT_CUA_MARKING = 'SWITCH'
  1482.    universal CUA_marking_switch
  1483.    if CUA_marking_switch then
  1484.  compile endif
  1485.       unmark
  1486.  compile if WANT_CUA_MARKING = 'SWITCH'
  1487.    endif
  1488.  compile endif
  1489. compile endif
  1490.    begin_line
  1491.  
  1492. compile if WANT_CUA_MARKING & EPM
  1493. def s_home =
  1494.    startline = .line; startcol = .col
  1495.    begin_line
  1496.    call extend_mark(startline, startcol, 0)
  1497. compile endif
  1498.  
  1499. def ins=insert_toggle
  1500. compile if EVERSION >='5.50'
  1501.    call fixup_cursor()
  1502. compile endif
  1503.  
  1504. def left=
  1505. compile if WANT_CUA_MARKING = 'SWITCH'
  1506.    universal CUA_marking_switch
  1507. compile endif
  1508. compile if WANT_STREAM_MODE = 'SWITCH'
  1509.    universal stream_mode
  1510.    if .line>1 & .col=1 & stream_mode $NOT_CMD_STATE then up; end_line; else left; endif
  1511. compile elseif WANT_STREAM_MODE
  1512.    if .line>1 & .col=1 $NOT_CMD_STATE then up; end_line; else left; endif
  1513. compile else
  1514.    left
  1515. compile endif
  1516. compile if WANT_CUA_MARKING
  1517.  compile if WANT_CUA_MARKING = 'SWITCH'
  1518.    if CUA_marking_switch then
  1519.  compile endif
  1520.       unmark
  1521.  compile if WANT_CUA_MARKING = 'SWITCH'
  1522.    endif
  1523.  compile endif
  1524. compile endif
  1525.  
  1526. compile if WANT_CUA_MARKING & EPM
  1527. def s_left =
  1528.    startline = .line; startcol = .col
  1529.    if .line>1 & .col=1 then up; end_line; else left; endif
  1530.    call extend_mark(startline, startcol, 0)
  1531. compile endif
  1532.  
  1533. compile if EVERSION < 5
  1534. def padminus=keyin '-'
  1535. def padplus=keyin '+'
  1536.  compile if EVERSION >= '4.10'
  1537. def padslash, c_padslash =keyin '/'     -- 4.10 for enhanced keyboard
  1538.  compile endif
  1539. def padstar=keyin '*'
  1540. compile endif
  1541. def pgup =
  1542. compile if WANT_CUA_MARKING
  1543.  compile if WANT_CUA_MARKING = 'SWITCH'
  1544.    universal CUA_marking_switch
  1545.    if CUA_marking_switch then
  1546.  compile endif
  1547.       unmark
  1548.  compile if WANT_CUA_MARKING = 'SWITCH'
  1549.    endif
  1550.  compile endif
  1551. compile endif
  1552.    page_up
  1553.  
  1554. def pgdn =
  1555. compile if WANT_CUA_MARKING
  1556.  compile if WANT_CUA_MARKING = 'SWITCH'
  1557.    universal CUA_marking_switch
  1558.    if CUA_marking_switch then
  1559.  compile endif
  1560.       unmark
  1561.  compile if WANT_CUA_MARKING = 'SWITCH'
  1562.    endif
  1563.  compile endif
  1564. compile endif
  1565.    page_down
  1566.  
  1567. def right=
  1568. compile if WANT_STREAM_MODE = 'SWITCH'
  1569.    universal stream_mode
  1570. compile endif
  1571. compile if WANT_CUA_MARKING
  1572.  compile if WANT_CUA_MARKING = 'SWITCH'
  1573.    universal CUA_marking_switch
  1574.    if CUA_marking_switch then
  1575.  compile endif
  1576.       unmark
  1577.  compile if WANT_CUA_MARKING = 'SWITCH'
  1578.    endif
  1579.  compile endif
  1580. compile endif
  1581. compile if WANT_STREAM_MODE
  1582.    if .line then l=length(textline(.line)); else l=.col; endif
  1583.  compile if WANT_STREAM_MODE = 'SWITCH'
  1584.    if .line<.last & .col>l & stream_mode $NOT_CMD_STATE then
  1585.  compile else
  1586.    if .line<.last & .col>l $NOT_CMD_STATE then
  1587.  compile endif
  1588.       down; begin_line
  1589.  compile if WANT_STREAM_MODE = 'SWITCH'
  1590.    elseif .line=.last & .col>l & stream_mode $NOT_CMD_STATE then   -- nop
  1591.  compile else
  1592.    elseif .line=.last & .col>l $NOT_CMD_STATE then  -- nop
  1593.  compile endif
  1594.    else
  1595.       right
  1596.    endif
  1597. compile else
  1598.    right
  1599. compile endif
  1600.  
  1601. compile if WANT_CUA_MARKING & EPM
  1602. def s_right =
  1603.    startline = .line; startcol = .col
  1604.    if .line then l=length(textline(.line)); else l=.col; endif
  1605.    if .line<.last & .col>l then
  1606.       down; begin_line
  1607.    elseif .line<>.last | .col<=l then
  1608.       right
  1609.    endif
  1610.    call extend_mark(startline, startcol, 1)
  1611. compile endif
  1612.  
  1613.  
  1614. def s_f1= /* scroll left */
  1615. compile if WANT_CUA_MARKING
  1616.  compile if WANT_CUA_MARKING = 'SWITCH'
  1617.    universal CUA_marking_switch
  1618.    if CUA_marking_switch then
  1619.  compile endif
  1620.       unmark
  1621.  compile if WANT_CUA_MARKING = 'SWITCH'
  1622.    endif
  1623.  compile endif
  1624. compile endif
  1625.    oldcursorx=.cursorx
  1626.    if .col-.cursorx then
  1627.       .col=.col-.cursorx
  1628.       .cursorx=oldcursorx
  1629.    elseif .cursorx>1 then
  1630.       left
  1631.    endif
  1632.  
  1633. def s_f2= /* scroll right */
  1634. compile if WANT_CUA_MARKING
  1635.  compile if WANT_CUA_MARKING = 'SWITCH'
  1636.    universal CUA_marking_switch
  1637.    if CUA_marking_switch then
  1638.  compile endif
  1639.       unmark
  1640.  compile if WANT_CUA_MARKING = 'SWITCH'
  1641.    endif
  1642.  compile endif
  1643. compile endif
  1644.   oldcursorx=.cursorx
  1645.   a=.col+.windowwidth-.cursorx+1
  1646.   if a<=MAXCOL then
  1647.      .col=a
  1648.      .cursorx=oldcursorx
  1649.   elseif .col<MAXCOL then
  1650.      right
  1651.   endif
  1652.  
  1653. def s_f3= /* scroll up */
  1654. compile if WANT_CUA_MARKING
  1655.  compile if WANT_CUA_MARKING = 'SWITCH'
  1656.    universal CUA_marking_switch
  1657.    if CUA_marking_switch then
  1658.  compile endif
  1659.       unmark
  1660.  compile if WANT_CUA_MARKING = 'SWITCH'
  1661.    endif
  1662.  compile endif
  1663. compile endif
  1664.   oldcursory=.cursory
  1665.   if .line-.cursory>-1 then
  1666.      .cursory=1
  1667.      up
  1668.      .cursory=oldcursory
  1669.   elseif .line then
  1670.      up
  1671.   endif
  1672.  
  1673. def s_f4= /* scroll down */
  1674. compile if WANT_CUA_MARKING
  1675.  compile if WANT_CUA_MARKING = 'SWITCH'
  1676.    universal CUA_marking_switch
  1677.    if CUA_marking_switch then
  1678.  compile endif
  1679.       unmark
  1680.  compile if WANT_CUA_MARKING = 'SWITCH'
  1681.    endif
  1682.  compile endif
  1683. compile endif
  1684.    oldcursory=.cursory
  1685.    if .line -.cursory+.windowheight<.last then
  1686.       .cursory=.windowheight
  1687.       down
  1688.       .cursory=oldcursory
  1689.    elseif .line<.last then
  1690.       down
  1691.    endif
  1692.  
  1693. def s_f5= /* center current line */
  1694. compile if WANT_CUA_MARKING
  1695.  compile if WANT_CUA_MARKING = 'SWITCH'
  1696.    universal CUA_marking_switch
  1697.    if CUA_marking_switch then
  1698.  compile endif
  1699.       unmark
  1700.  compile if WANT_CUA_MARKING = 'SWITCH'
  1701.    endif
  1702.  compile endif
  1703. compile endif
  1704.    oldline=.line
  1705.    .cursory=.windowheight%2
  1706.    oldline
  1707.  
  1708. compile if EVERSION < 5
  1709. def s_pad5=keyin '5'
  1710. compile endif
  1711.  
  1712. def s_tab=
  1713.    universal matchtab_on
  1714. compile if WANT_CUA_MARKING
  1715.  compile if WANT_CUA_MARKING = 'SWITCH'
  1716.    universal CUA_marking_switch
  1717.    if CUA_marking_switch then
  1718.  compile endif
  1719.       unmark
  1720.  compile if WANT_CUA_MARKING = 'SWITCH'
  1721.    endif
  1722.  compile endif
  1723. compile endif
  1724. compile if EVERSION < 5
  1725.    call init_operation_on_commandline()
  1726. compile endif
  1727.    if matchtab_on & .line>1 $NOT_CMD_STATE then
  1728.       up
  1729.       backtab_word
  1730.       down
  1731.    else
  1732.       backtab
  1733.    endif
  1734. compile if EVERSION < 5
  1735.    call move_results_to_commandline()
  1736. compile endif
  1737.  
  1738. compile if EPM
  1739. def space, s_space, c_space  /* New in EPM.  Space is a virtual key under PM.*/
  1740.  compile if WANT_CUA_MARKING
  1741.   compile if WANT_CUA_MARKING = 'SWITCH'
  1742.    universal CUA_marking_switch
  1743.    if CUA_marking_switch then
  1744.   compile endif
  1745.       call process_mark_like_cua()
  1746.   compile if WANT_CUA_MARKING = 'SWITCH'
  1747.    endif
  1748.   compile endif
  1749.  compile endif
  1750.  compile if EVERSION >= '5.20'
  1751.    k=lastkey(1)
  1752.  compile endif
  1753.    keyin ' '
  1754.  compile if EVERSION >= '5.20'
  1755.    if k<>' ' then
  1756.       undoaction 1, junk                -- Create a new state
  1757.    endif
  1758.  compile endif
  1759. compile endif
  1760.  
  1761. def tab=
  1762. compile if WANT_STREAM_MODE = 'SWITCH'
  1763.    universal stream_mode
  1764. compile endif
  1765.    universal matchtab_on
  1766. compile if TOGGLE_TAB
  1767.    universal TAB_KEY
  1768. compile endif
  1769. compile if WANT_CUA_MARKING = 'SWITCH'
  1770.    universal CUA_marking_switch
  1771. compile endif     -------Start of logic:
  1772. compile if TOGGLE_TAB
  1773.    if TAB_KEY then
  1774.  compile if WANT_CUA_MARKING
  1775.   compile if WANT_CUA_MARKING = 'SWITCH'
  1776.       if CUA_marking_switch then
  1777.   compile endif
  1778.           process_key(\9)
  1779.   compile if WANT_CUA_MARKING = 'SWITCH'
  1780.       else
  1781.   compile endif
  1782.  compile endif  -- WANT_CUA_MARKING
  1783.          keyin \9
  1784.  compile if WANT_CUA_MARKING = 'SWITCH'
  1785.       endif
  1786.  compile endif
  1787.    else
  1788. compile endif  -- TOGGLE_TAB
  1789. compile if WANT_CUA_MARKING
  1790.  compile if WANT_CUA_MARKING = 'SWITCH'
  1791.    if CUA_marking_switch then
  1792.  compile endif
  1793.       unmark
  1794.  compile if WANT_CUA_MARKING = 'SWITCH'
  1795.    endif
  1796.  compile endif
  1797. compile endif
  1798. compile if EVERSION < 5
  1799.    call init_operation_on_commandline()
  1800. compile endif
  1801.    oldcol=.col
  1802.    if matchtab_on and .line>1 $NOT_CMD_STATE then
  1803.       up
  1804.       c=.col
  1805.       tab_word
  1806.       if oldcol>=.col then
  1807.          .col=oldcol
  1808.          tab
  1809.       endif
  1810.       down
  1811.    else
  1812.       tab
  1813.    endif
  1814. compile if WANT_STREAM_MODE
  1815.  compile if WANT_STREAM_MODE = 'SWITCH'
  1816.    if insertstate() & stream_mode $NOT_CMD_STATE then
  1817.  compile else
  1818.    if insertstate() $NOT_CMD_STATE then
  1819.  compile endif
  1820.       numspc=.col-oldcol
  1821.       if numspc>0 then
  1822.          .col=oldcol
  1823.          keyin substr('',1,numspc)
  1824.       endif
  1825.    endif
  1826. compile endif
  1827. compile if EVERSION < 5
  1828.    call move_results_to_commandline()
  1829. compile endif
  1830. compile if TOGGLE_TAB
  1831.    endif
  1832. compile endif  -- TOGGLE_TAB
  1833.  
  1834.  
  1835. def up=
  1836. compile if WANT_CUA_MARKING
  1837.  compile if WANT_CUA_MARKING = 'SWITCH'
  1838.    universal CUA_marking_switch
  1839.    if CUA_marking_switch then
  1840.  compile endif
  1841.       unmark
  1842.  compile if WANT_CUA_MARKING = 'SWITCH'
  1843.    endif
  1844.  compile endif
  1845. compile endif
  1846. compile if WANT_STREAM_MODE
  1847.    call updownkey(0)
  1848. compile else
  1849.    up
  1850. compile endif
  1851. compile if not TOP_OF_FILE_VALID
  1852.    if not .line then '+1'; endif
  1853. compile endif
  1854.  
  1855. compile if WANT_CUA_MARKING & EPM
  1856. def s_up=
  1857.  compile if WANT_CUA_MARKING = 'SWITCH'
  1858.    universal CUA_marking_switch
  1859.  compile endif
  1860.    startline = .line; startcol = .col
  1861.  compile if WANT_STREAM_MODE
  1862.    call updownkey(0)
  1863.  compile else
  1864.    up
  1865.  compile endif
  1866. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1867. ;  if CUA_marking_switch then
  1868. ;compile endif
  1869.    if .line then call extend_mark(startline, startcol, 0); endif
  1870. ;compile if WANT_CUA_MARKING = 'SWITCH'
  1871. ;  endif
  1872. ;compile endif
  1873.  compile if not TOP_OF_FILE_VALID
  1874.    if not .line then '+1'; endif
  1875.  compile endif
  1876. compile endif
  1877.  
  1878. compile if EPM  -- Standard PM clipboard functions.
  1879. def s_del = 'cut'
  1880.  
  1881. def s_ins =
  1882.  compile if WANT_CUA_MARKING = 'SWITCH'
  1883.    universal CUA_marking_switch
  1884.    if CUA_marking_switch then
  1885.  compile endif
  1886.  compile if WANT_CUA_MARKING
  1887.       call process_mark_like_cua()
  1888.  compile endif
  1889.  compile if WANT_CUA_MARKING = 'SWITCH'
  1890.    endif
  1891.  compile endif
  1892.    'paste' DEFAULT_PASTE
  1893.  
  1894. def c_ins = 'copy2clip'
  1895. compile endif
  1896.  
  1897. compile if WANT_STREAM_MODE
  1898. defproc updownkey(down_flag)
  1899.    universal save_cursor_column
  1900.  compile if WANT_STREAM_MODE = 'SWITCH'
  1901.    universal stream_mode
  1902.    if stream_mode then
  1903.  compile endif
  1904.       lk = lastkey(1)
  1905.  compile if EPM
  1906.       updn = pos(leftstr(lk,1),\x18\x16) & pos(substr(lk,2,1),\x02\x0A\x12)   -- VK_DOWN or VK_UP, plain or Shift or Ctrl
  1907.  compile else
  1908.       updn = substr(lk,1,1)=\0 & pos(substr(lk,2,1),\x48\x50\x98\xA0\x8d\x91) -- Up, down, a_up, a_down, c_up, c_down
  1909.  compile endif
  1910.       if not updn then save_cursor_column = .col; endif
  1911.  compile if WANT_STREAM_MODE = 'SWITCH'
  1912.    endif
  1913.  compile endif
  1914.  
  1915.    if down_flag then down else up endif
  1916.  
  1917.  compile if WANT_STREAM_MODE = 'SWITCH'
  1918.    if .line & stream_mode then
  1919.  compile else
  1920.    if .line then
  1921.  compile endif
  1922.       l = length(textline(.line))
  1923.       if updn & l>=save_cursor_column then
  1924.          .col = save_cursor_column
  1925.       elseif updn | l<.col then
  1926.          end_line
  1927.       endif
  1928.    endif
  1929. compile endif  -- WANT_STREAM_MODE
  1930.  
  1931. /* ------ Keys unused in standard E ------------------------------------------
  1932.  
  1933. a_2, a_3, a_5, a_6, a_7, a_8, a_9
  1934.  
  1935. a_f2, a_f3, a_f4, a_f5, a_f6, a_f9
  1936.  
  1937. a_g, a_h, a_i, a_k, a_q, a_v
  1938.  
  1939. c_6, c_minus, c_backslash
  1940.  
  1941. c_leftbracket, c_rightbracket, (EOS2 only:) a_leftbracket, a_rightbracket
  1942.  
  1943. c_f9, c_f10
  1944.  
  1945. c_g, c_i, c_j, c_prtsc, c_q, c_u
  1946.  
  1947. f5
  1948.  
  1949. s_f6, s_f7, s_f8, s_f9, s_f10
  1950.  
  1951. -----  The following is for EOS2 4.10 or above only.  -----
  1952.  
  1953. New keys that work on even older unenhanced AT keyboards:
  1954.    c_up, c_down
  1955.    pad5, c_pad5
  1956.    c_padminus, c_padplus, c_padstar
  1957.    c_ins, c_del
  1958.    c_tab, a_tab
  1959.    a_leftbracket, a_rightbracket
  1960.  
  1961. On an enhanced keyboard only:
  1962.    f11, f12, and c_,s_,a_
  1963.    pad_enter               is defined the same as enter
  1964.    a_enter and a_padenter are defined the same as enter
  1965.    c_pad_enter             is defined the same as c_enter
  1966.    pad_slash               is defined the same as '/'
  1967.    c_padslash              is defined the same as '/'
  1968.  
  1969. -----  The following is for EPM only.  -----
  1970.   * Since we are using only keys defined by PM (and not looking at
  1971.     scan codes), we no longer have the keys:
  1972.       padplus, c_padplus, c_padstar
  1973.       pad_slash, c_padslash
  1974.       pad5, c_pad5
  1975.    * We gained the new keys:
  1976.     - space, s_space, c_space, and a_space
  1977.          (The space bar is a virtual key to PM, not a character key.  If you
  1978.          want to bind an action to the space key, write  def space=  instead of
  1979.          the old  def ' '= .  The good news is that you get all the shift
  1980.          states of the space bar, although alt_space is preempted by PM.)
  1981.     - c_1 through c_0
  1982.          (So now we have a complete set of alt- and ctrl-digits.)
  1983. ---------------------------------------------------------------------------- */
  1984.  
  1985.