!--- EDIT # 0066 8 Jan 1981 12:04:08 DR0:[2,2]KEYS.TES;77 ! !--- PREVIOUS EDIT 2 Oct 1980 12:06:36 DR1:[300,3]KEYS.TES;76 ! ! Macro to field immediate-mode commands, TECO V35 only ! ! Cursor keys do the natural thing. Any unknown commands ring the bell ! ! 1st arg (type) into A, 2nd arg (char--range 0-31.) into B! ! Type 1 = ESC letter ---> cursor keys & PF1-PF4 ! ! Type 0 = ESC CTRL-CHAR ! ! Type 2 = Alternate keypad ! ! IF it is a scope, and a VT52 or VT100, set alternate keypad mode! ! CRTRUB (for immediate mode keys) was modified to pass the lower 7 bits of the character, instead of only the lower 5 bits. ! ! Q-registers used: ! ! %A - The immediate command type & scratch ! ! %B - The immediate command character & scratch ! ! %C - Scratch ! ! ! ! $A - This macro, to handle immediate commands ! ! $B - The macro which handles screen inserts ! ! $C - Word delimiters & Macro for "ESC-X" Q-register insert ! ET&2"N 0:W-5"L 0,1ET 27^T ^^=^T 1,0ET'' EI @^UA?UBUA  ! Load up Q-REG C with the word delimiters ! 32^UC 9:^UC 44:^UC 13:^UC 10:^UC 47:^UC @:^UC%()+-*^\!=:<>/.% QA-1"E ! Type 1 ! QB-95"G QB-32UB' ! Convert lower case to upper case ! ! Treat ESC-comma thru ESC-9 as KP-comma thru KP9 (for those terminals which don't have an alternate keypad mode, such as the Hazeltine 1500 ! QB-58"L QB-43"G 64%B @O!TYPE2! '' QB-65"E ."N 0^QUA -QAUA -L^Q-2UB QB-QA"G QAC | QBC'' | QB-66"E Z-."N 0^QUA -QAUA L^Q-2UB QB-QA"G QAC | QBC'' | QB-68"E ."N R' | QB-67"E Z-."N C' | ! PF2 or ESC-F = jump to next word ! QB-70"E 81UB' QB-81"E 1 ."E ZJ' | ! PF1 or PF3 or ESC-R = JUMP TO PREV WORD ! QB-82"E 80UB' QB-80"E 1<-.; R-SGC; R-SGC;> | ! ESC I = SCREEN-TEXT INSERT ! QB-73"E !INS! ET&512"N MB | 3<7>' | ! ESC-X = PUT MARKED REGION IN A Q-REGISTER ! QB-88"E @^UC%X% 0,8ET :^UC 8,0ET 4:W"N 4:W-1U1 Q1-."L Q1,.MC | .,Q1MC'' | ! ESC-K = DELETE MARKED REGION ! QB-75"E 4:W"N 4:W-1U1 Q1-."L Q1,.D | .,Q1D' 0,4:W' | ! ESC-S = Toggle SEEALL mode ! QB-83"E 3:W^_,3:W | ! ESC-W = Toggle screen width (132 vs 80) if this is a VT-100! QB-87"E 0:W-4"E 7:WUA 0,7:W 1:W-80"E 104UB 132,1:W 14,2:W 4UC | 108UB 80,1:W 24,2:W 6UC' 0,1ET 27^T 91^T 63^T 51^T QB^T 1,0ET QA"N QC,7:W'' | 3<7> ''''''''''' | QA-2"E ! TYPE 2--ALTERNATE KEYPAD! !TYPE2! QB-77"E @O!INS! | QB-110"E S | QB-112"E 2:WL | ! KP0 = MOVE WINDOW DOWN ! QB-113"E -(2:W)L | ! KP1 = MOVE WINDOW UP ! QB-115"E 0,32+8ET <1 ."E ZJ' ; .-Z; -1W> 32+8,0ET| ! KP3 = CONTINOUS NEXT WORD (RIGHT) ! QB-114"E 0,32+8ET <1<-.; R-SGC; R-SGC;> ; 0-.; -1W> 32+8,0ET | ! KP2 = CONTINUOUS PREV WORD (LEFT) ! ! KP4 = CONTINUOUS NEXT LINE ! QB-116"E 0,32+8ET 32+8,0ET | ! KP7 = CONTINOUS PREV LINE ! QB-119"E 0,32+8ET <-L ; 0-.; -1W> 32+8,0ET | QB-117"E .-Z"N D' | ! KP5 = DELETE NEXT CHAR ! QB-118"E -2D | ! KP6 = Delete to end-of-line ! QB-108"E MM | ! KP COMMA = EXECUTE MACRO M ! QB-121"E 4:W-1-."E 7 0,4:W | .+1,4:W' | ! KP9 = MARK ! QB-120"E I 2R | ! KP8 = INSERT CR-LF AFTER CURSOR! 3<7^T >''''''''''''' | ! other types, just ignore! '' ? 0,32ED ! Macro to put in Q-Reg B, which will do screen-text-insert ! @^UB?:7W"N -99W' !AGAIN! -256+0:WU0 Q0#32768-32768U1 Q1-127"E ."N R 0AU0 D Q0-10"E F< | Q0-13"E F<' @O!AGAIN!''' Q1-13"E I   F<' Q1-27"N Q1I @O!AGAIN!' ! A NON-ESC CONTROL CHAR ! ! The char was ESC; if next is also, go away, else insert it (unless it is a DEL) & continue ! 0,8ET U1 8,0ET Q1-27"N Q1-127"N 27I Q1I' @O!AGAIN!' 0,1ET 0:W-6"E 126 17 96 2:W+96 126 23 | 27 [24;H 27 [K' 1,0ET ? !End of KEYS.TES!