From: Joe Bloggs [JBloggs@acme.com] Sent: Friday, June 02, 2006 6:10 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: [VT200 and up] Defining UDK On 2 Jun 2006 14:10:02 -0200, peter@langstoeger.at (Peter 'EPLAN' LANGSTOEGER) wrote: >I once had (and maybe even wrote it) a little program to make use of the >User Definable Keys (UDK) of a VT220 be translating the definitions in a >textfile to escape sequences sent. I had F6-F20 with three different UDK >meanings (Shift, Control and Shift-Control) defined (in addition to the >normal definition, which is an unchangeable escape sequence) from DCL, it's a bit ugly, but doable; outtputting, + + + one such magic sequence was 1;1| I'd have to dig in the closet for the VT200 programmer's booklet to find more. the bits below, date from 4.7/5.x days (beginner DCL) $ @UDK.COM F19 "ATTACH/PARENT" $! $! lines not beginning with $, wrapped from prior line by nntp client $! $ set noon $ key_list = "*F6*F7*F8*F9*F10*F11*F12*F13*F14*HELP*DO*F17*F18*F19*F20* $ key_num_list = "*17*18*19*20*21*23*24*25*26*28*29*31*32*33*34* $ delimiter = "*" $!+ $! look for P1 in key list; $! if found in list, save index of the list position $!- $ i = 0 $ LOOP1: $ x = f$element( i+1, delimiter, key_list ) $ if( x .eqs. p1 ) then goto END_LOOP1 $ if( x .eqs. delimiter ) then goto END_LOOP1 $ i = i + 1 $ goto LOOP1 $ END_LOOP1: $! $ no_match = ( x .eqs. delimiter ) ! True if not found $ if( no_match ) then write sys$output "Invalid key name; not set ... " $ if( no_match ) then exit $! $ key_num = f$element( i+1, delimiter, key_num_list ) $ dcs[0,8] = %X090 ! terminals set to 8-bit: CSI (144) $ st[0,8] = %X09C ! ST (156) $! $! dcs[0,16] = %X05B1B ! terminals set to 7-bit: esc-[ $! st[0,16] = %X02A1B ! esc-/ $! $! esc[0,8] = %X01B ! 27 $! left_brkt[0,8] = %X05B ! 91 $! forw_slsh[0,8] = %X02A ! 47 $! $! dcs = esc + left_brkt ! terminals set to 7-bit : esc-[ $! st = esc + forw_slsh ! esc-/ $! $ len = f$length( p2 ) $ hex_str1 = "" $ i = 0 $ NEXT_I: $ hex_str1 = hex_str1 + f$fao( "!XB",f$cvsi(0,8,f$extract( i, 1, p2 ))) $ i = i + 1 $ if( i .lt. len ) then goto NEXT_I $ len = f$length( p3 ) $ hex_str2 = "" $ j = 0 $ if( "''p3'" .eqs. "" ) then goto SET_KEY $! $ NEXT_J: $ hex_str2 = hex_str2 + f$fao( "!XB",f$cvsi(0,8,f$extract( j, 1, p3 ))) $ j = j + 1 $ if( j .lt. len ) then goto NEXT_J $!+ $! the "1;1" implies: clear re-def'ed keys only; don't lock against re-def $!- $ SET_KEY: $ if( "''p3'" .eqs. "" ) then ctrl_str = dcs + "1;1|" + key_num + "/" + hex_str1 + "0D" + st $ if( "''p3'" .nes. "" ) then ctrl_str = dcs + "1;1|" + key_num + "/" + hex_str1 + "0D" + hex_str2 + "0D" + st $ tab[0,8] = 9 $! $ write sys$output tab + tab + "...setting key" $ write sys$output ctrl_str