Submission for AMUS.LOG "Tidbits" Column from Joe Buller (415) 283-4498




"MORE FUNKEY STUFF"

I just KNEW it could be done, but hadn't had or taken the time to find out HOW
until Mike Foley's Tidbit appeared in the February '86 AMUS.LOG. I have a
number of applications where I use AlphaVue-style control character sequences
(e.g. ^B to insert a line, ^F to insert a character, et al) and have wanted to
use the labeled editting keys on an AM6x terminal rather than having to
initially train novice users on the use of control key combinations. I created
the following FUNKEY.BAS program which in turn creates a FUNction KEY
definition file which does the actual key translation as indicated by the
comments on each source line:
!
! QWKIE PROGRAM TO CREATE FUNKEY.PFK
! TRANSLATES AM62x EDIT KEYS TO CONTROL CHARACTERS
! JHB 2/17/86
!
OPEN #1,"FUNKEY.PFK",OUTPUT
PRINT #1,CHR(138);CHR(162);
PRINT #1,CHR(206);CHR(6);CHR(0);        ! INSERT CHARACTER = ^F
PRINT #1,CHR(207);CHR(4);CHR(0);        ! DELETE CHARACTER = ^D
PRINT #1,CHR(177);
FOR X = 1 TO 8
        PRINT #1,CHR(6);                ! INSERT WORD = EIGHT ^Fs
NEXT X  
PRINT #1,CHR(0);
PRINT #1,CHR(178);CHR(22);CHR(0);       ! DELETE WORD = ^V
PRINT #1,CHR(232);CHR(2);CHR(0);        ! INSERT LINE = ^B
PRINT #1,CHR(313);CHR(26);CHR(0);       ! DELETE LINE = ^Z
! NOTE: MUST DISABLE CHR(313) TRANSLATION IN AM62A.M68/TDV
PRINT #1,CHR(247);CHR(23);CHR(0);       ! NEXT WORD = ^W
PRINT #1,CHR(231);CHR(23);CHR(0);       ! Shift NEXT WORD = ^W
PRINT #1,CHR(209);CHR(1);CHR(0);        ! PREVIOUS WORD = ^A
PRINT #1,CHR(215);CHR(1);CHR(0);        ! Shift PREVIOUS WORD = ^A
PRINT #1,CHR(246);CHR(20);CHR(0);       ! NEXT SCREEN = ^T
PRINT #1,CHR(214);CHR(5);CHR(0);        ! Shift NEXT SCREEN = ^E
PRINT #1,CHR(242);CHR(18);CHR(0);       ! PREVIOUS SCREEN = ^R
PRINT #1,CHR(241);CHR(30);CHR(0);       ! Shift PREVIOUS SCREEN = ^^
PRINT #1,CHR(184);"?";CHR(13);CHR(0);   ! HELP = ?^M
PRINT #1,CHR(185);"?";CHR(13);CHR(0);   ! Shift HELP = ?^M
PRINT #1,CHR(222);CHR(11);CHR(0);       ! Shift UP ARROW = ^K
PRINT #1,CHR(223);CHR(10);CHR(0);       ! Shift DOWN ARROW = ^J
PRINT #1,CHR(219);CHR(21);CHR(0);       ! Shift LEFT ARROW = ^U
PRINT #1,CHR(220);CHR(14);CHR(0);       ! Shift RIGHT ARROW = ^N
PRINT #1,CHR(251);CHR(30);CHR(0);       ! Shift HOME = ^^
PRINT #1,CHR(161);CHR(13);CHR(0);       ! NEW LINE = ^M
PRINT #1,CHR(162);CHR(25);CHR(0);       ! Shift NEW LINE = ^Y
PRINT #1,CHR(235);"PRINT";CHR(13);CHR(0); ! Shift PRINT = PRINT^M
PRINT #1,CHR(236);"PRINT";CHR(13);CHR(0); ! PRINT = PRINT^M
PRINT #1,CHR(179);CHR(19);CHR(0);       ! Shift NO SCROLL = ^S
PRINT #1,CHR(234);CHR(1);CHR(0);        ! BACK TAB = ^A
PRINT #1,CHR(233);CHR(21);CHR(0);       ! Shift BACK TAB = ^U
PRINT #1,CHR(201);CHR(9);CHR(0);        ! Shift TAB = ^I
CLOSE #1
PRINT
PRINT "FUNKEY.PFK file is now available"
END

After compiling and running the program, I now load the resultant output file
into user memory of each job via a 'LOAD DSKx:FUNKEY.PFK[p,pn]' statement in a
START.CMD procedure. (I found that loading this file into SYSTEM memory during
bootup, unfortunately, would NOT work as desired.) The net result of all this
is that the terminal's editting keys now produce the same results in or out of
Vue.  Note that if you want to be able to translate the DELETE-LINE key into
something other than a ^U then: the AM6x.M68[10,2] file will need to be editted
and the "BYTE 313,'U-100" statement commented out; the file M68'd; and the new
AM6x.TDV copied over to [1,6].


To determine the character code returned from any of the special keys on the
keyboard, I compiled and ran the following FUNTST.BAS program:
!
! QWKIE TEST FOR CREATING FUNCTION KEY .PFK FILE. jhb 2/17/86
!
OPEN #1,"FUNTST.PFK",OUTPUT
PRINT #1;CHR(138);CHR(162);
FOR X = 128 TO 255
        PRINT #1;CHR(X);X USING "#ZZ"
        PRINT #1;CHR(0);
NEXT X
CLOSE #1

After loading the FUNTST.PFK file into user memory, depress any combination of
special keycaps, with/without SHIFT and/or FUNCTion key use, and the resultant
code will be echoed by AMOS as misunderstood commands (e.g. the HELP key
returns ?185?, and SHIFT-HELP returns ?184?).  For non-AM6x terminals, this
program may be helpful in determining whether or not your terminal driver
supports the .PFK conventions.


Files named FUNKEY.BAS, FUNKEY.HLP and FUNTST.BAS are available on the AMUS
network.


Joe Buller
*Applied Micronetics, Inc.
Lafayette, CA


.
