• Aucun résultat trouvé

USING VISUAL MODE WITH THE ONTEL AMIGO

Dans le document The MTS File Editor (Page 115-120)

The keyboard layout for the Ontel Amigo terminal is the same as for the IBM PC.

The movement of the cursor is controlled by the CURSOR-RIGHT, CURSOR-LEFT, CURSOR-UP, and CURSOR-DOWN keys. These keys are labelled with arrows. Movement of the cursor is also controlled by the TAB, HOME, and RETURN keys.

The following keys on the Ontel Amigo have special functions in visual mode. The actions of these keys are controlled only by the terminal routines and not by the editor program itself.

Amigo Key Effect

Ins Enter or exit insertion mode (toggle switch) Del Delete the character at the cursor

SHIFT-Del Delete the word at the cursor

SHIFT-Bkspc (←) Delete all characters to the right of the cursor Esc Discard all current line changes

SHIFT-Esc Discard all current screen changes SHIFT-Home Move cursor to work field

Along the left side of the keyboard is the program-function pad. These ten keys are called program-function keys and are labelled F1 through F10. Each program-function key has four Amigo program functions associated with it, one for each of the four possible key positions (unshifted-Fx, SHIFT-Fx, CTRL-Fx, and CTRL-SHIFT-Fx). These Amigo program functions are named PFA0 through PFA15, PFB0 through PFB15, and PFC0 through PFC8.

Normally (when not in visual mode), the program-function keys execute terminal device commands.

In visual mode, each of the program-function keys is assigned to an editor visual program function (VPF) for visual-mode editing. These visual program functions in turn are assigned to visual-mode commands. The default key assignments for the Ontel Amigo terminal are as follows:

VPF Amigo Key Amigo PF Default Assignment

−2 CTRL-C - VEXIT ED_WORK

−1 CTRL-E - VEXIT

0 PrtSc PFA0 VUPDATE

1 F1 PFA1 LINE *VT COUNT=−10

2 F2 PFA2 VPFB

3 F3 PFA3 VMEMORY 1

4 F4 PFA4 LINE *VT COUNT=10

5 F5 PFA5 VPFE

6 F6 PFA6 VMEMORY 2

7 F7 PFA7 LINE *VT COUNT=1

8 F8 PFA8 VEXECUTE

9 F9 PFA9 VMEMORY 3

10 F10 PFA10 VINSERT 1 2

11 SHIFT-F1 PFA11 VEXTEND

12 SHIFT-F2 PFA12 VPREVIOUS

13 SHIFT-F3 PFA13 LINE *VT COUNT=−10

14 SHIFT-F4 PFA14 VPFB

15 SHIFT-F5 PFA15 VMEMORY 1

Visual Mode 115

16 SHIFT-F6 PFB0 LINE *VT COUNT=10

17 SHIFT-F7 PFB1 VPFE

18 SHIFT-F8 PFB2 VMEMORY 2

19 SHIFT-F9 PFB3 LINE *VT COUNT=1

20 SHIFT-F10 PFB4 VEXECUTE

21 CTRL-F1 PFB5 VMEMORY 3

22 CTRL-F2 PFB6 VINSERT 1 2

23 CTRL-F3 PFB7 VEXTEND

Note that the default assignments for editor visual program functions (VPFs) 1 through 12 are the same as for 13 through 24. Editor VPFs 25 through 40 are initially undefined, but they may be defined by the user (see the section “Reassigning Amigo Visual Program Functions” below).

Reassigning Amigo Visual Program Functions

The example below illustrates how the editor visual program functions may be reassigned to make the Amigo program-function pad more versatile.

VPF 1=VPFB (reassign F1 (PFA1))

VPF 2=VPFE (reassign F2 (PFA2))

VPF 3=VEXECUTE (reassign F3 (PFA3))

VPF 4=VSPLIT (reassign F4 (PFA4))

VPF 5=VINSERT 1 2 (reassign F5 (PFA5))

VPF 6=VEXTEND (reassign F6 (PFA6))

VPF 7=VMEMORY 1 (reassign F7 (PFA7)) VPF 8=VMEMORY 2 (reassign F8 (PFA8)) VPF 9=VMEMORY 3 (reassign F9 (PFA9)) VPF 10=VPREVIOUS (reassign F10 (PFA10)) VPF 11=LINE *VT COUNT=-1 (reassign SHIFT-F1 (PFA11)) VPF 12=LINE *VT COUNT=1 (reassign SHIFT-F2 (PFA12)) VPF 13=LINE *VT COUNT=-10 (reassign SHIFT-F3 (PFA13)) VPF 14=LINE *VT COUNT=10 (reassign SHIFT-F4 (PFA14)) VPF 15=LINE *VT COUNT=-100 (reassign SHIFT-F5 (PFA15)) VPF 16=LINE *VT COUNT=100 (reassign SHIFT-F6 (PFB0)) VPF 17=LINE *VT COUNT=-1000 (reassign SHIFT-F7 (PFB1)) VPF 18=LINE *VT COUNT=1000 (reassign SHIFT-F8 (PFB2)) VPF 19=LINE *F (reassign SHIFT-F9 (PFB3)) VPF 20=LINE *L (reassign SHIFT-F10 (PFB4))

116 Visual Mode

Editor visual program functions VPF 1 through VPF 12 are rearranged so that they more logically fit the Amigo program-function pad. Editor visual program functions VPF 13 through VPF20 are reassigned to different visual mode commands so that they do not duplicate VPF 1 through VPF 12. In this example, a selection of visual mode and normal edit commands is chosen so that the user may easily move around within the file.

As a second example, the following editor initialization file will reassign part of the program functions to visual-mode commands, part to normal editor commands, and part to edit procedures to provide more advanced capabilities for the program-function pad.

*

* Define a procedure to execute a %GRAB device

* command to initiate a second session

*

* Define a procedure to execute a %FLIP device

* command to switch to the alternate session

*

* Define a procedure to set variable A

* to beginning line for MOVE after

* moving the cursor to desired line

*

PROCEDURE !SETA LET A=*

END

*

* Set variable B to ending line for MOVE

* after moving the cursor to desired line

*

PROCEDURE !SETB LET B=*

END

*

* Define a procedure to clear work area

* before executing a VPFB command

*

* Redefine some PF keys

*

VPF 21=!GRAB (reassign CTRL-F1 (PFB5))

VPF 22=!FLIP (reassign CTRL-F2 (PFB6))

VPF 23=!SETA (reassign CTRL-F3 (PFB7))

VPF 24=!SETB (reassign CTRL-F4 (PFB8))

VPF 25=MOVE A B TO * (reassign CTRL-F5 (PFB9)) VPF 26=COMBINE * *N LEN=65 (reassign CTRL-F6 (PFB10)) VPF 27=COPY * TO * (reassign CTRL-F7 (PFB11)) VPF 28=RENUMBER (reassign CTRL-F8 (PFB12))

Visual Mode 117

VPF 29=!VPFB (reassign CTRL-F9 (PFB13))

VPF 30=VPFE (reassign CTRL-F10 (PFB14))

The above example illustrates how edit procedures may be used to execute terminal device commands and more complex editor commands. PFB5 and PFB6 have been reassigned to execute the %GRAB and %FLIP terminal device commands. These commands are executed via the MTS $CONTROL command (see MTS Volumes 1 and 4 for further details about issuing terminal device commands via the $CONTROL command). The edit UNLOCK command writes the current changes on the screen into the edit file and unlocks the file before the device command is executed. PFB7, PFB8, and PFB9 have been reassigned to work in concert to easily move lines in the file from one location to another.

PFB7 and PFB8 specify the beginning and ending bounds of the lines to be moved and PFB9 moves the text to the location specified by the current position of the cursor. PFB10 has been reassigned to the COMBINE command to combine the line pointed to by the cursor with the next line; the resultant lines are limited to 65 characters. PFB11 is reassigned to the COPY command to duplicate the line pointed to by the cursor. PFB12 is reassigned to the RENUMBER command. PFB13 has altered the VPFB command so that the work area is emptied before the insertion is performed.

Redefining the Amigo Keyboard

The Ontel Amigo terminal supports a total of 48 Ontel program functions, named PFA0 through PFA15, PFB0 through PFB15, and PFC0 through PFC15. By default, program-function keys F0 through F10 are defined as Amigo program functions PFA0 through PFA15, PFB0 through PFB15, and PFC0 through PFC8. The other Ontel program functions PFC9 through PFC15 must be assigned to specific terminal keys by the user.

The %FUNCTION device command may be used to assign the Amigo program functions. The

%FUNCTION device command is given in the form

%FUNCTION n m

where “n” is a hexadecimal value describing the key to be reassigned and “m” is a hexadecimal value describing the function to be assigned to the key.

The hexadecimal values for program-function keys F0 through F10 on the program-function pad are as follows:

Hex Value Hex Value Hex Value Hex Value

Key Unshifted Shifted CTRLed CTRL/Shifted

F1 80 90 A0 B0

The hexadecimal values for the keys on the Amigo numeric pad are as follows:

118 Visual Mode

Hex Value Hex Value Hex Value Hex Value

Key Unshifted Shifted CTRLed CTRL/Shifted

(Ins) C0 D0 E0 F0

The hexadecimal values for the Ontel program functions are as follows:

Program Function Hex Value Editor VPF PFA0 through PFA15 80 through 8F 0 through 15 PFB0 through PFB15 90 through 9F 16 through 31 PFC0 through PFC15 A1 through AF 32 through 48

As an example of assigning the Amigo program functions PFB8 through PFC0 for use with visual mode from the Ontel Amigo terminal, the following editor initialization file could be constructed.

$CONTROL *MSOURCE* FUNCTION C1 A1

$CONTROL *MSOURCE* FUNCTION C2 A2

$CONTROL *MSOURCE* FUNCTION C3 A3

$CONTROL *MSOURCE* FUNCTION C4 A4

$CONTROL *MSOURCE* FUNCTION C5 A5

$CONTROL *MSOURCE* FUNCTION C6 A6

$CONTROL *MSOURCE* FUNCTION C7 A7

$CONTROL *MSOURCE* FUNCTION C8 A8

$CONTROL *MSOURCE* FUNCTION C9 A9

VPF 31=LINE *VT COUNT=100 (reassign 1 key (PFC1)) VPF 32=LINE *VT COUNT=200 (reassign 2 key (PFC2)) VPF 33=LINE *VT COUNT=300 (reassign 3 key (PFC3)) VPF 34=LINE *VT COUNT=400 (reassign 4 key (PFC4)) VPF 35=LINE *VT COUNT=500 (reassign 5 key (PFC5)) VPF 36=LINE *VT COUNT=600 (reassign 6 key (PFC6)) VPF 37=LINE *VT COUNT=700 (reassign 7 key (PFC7)) VPF 38=LINE *VT COUNT=800 (reassign 8 key (PFC8)) VPF 39=LINE *VT COUNT=900 (reassign 9 key (PFC9))

In the above example, the $CONTROL *MSOURCE* FUNCTION command redefines the Ontel Amigo numeric pad keys to Amigo program functions PFC1 through PFC9. These keys are subsequently assigned by the VPF command to the editor visual program functions VPF 31 through VPF 39. This converts the numeric-pad number keys into keys that advance the screen by a count of (key-number*100).

Visual Mode 119

Dans le document The MTS File Editor (Page 115-120)