B. Defining Function and Control Keys : Mapping File Syntax : Mapping Statements : Example of Mapping Statements (UNIX and VMS)
 
Share this page                  
Example of Mapping Statements (UNIX and VMS)
frskey8 = pf16 (0)
menuitem1 = pf13 (1)
menuitem2 = pf3 (PF3)
menuitem3 = controlE (^E)
previousfield = controlP
nextfield = rightarrow
menuitem4 = pf9 (4)
rubout = controlDEL
In this example, PF16 (the 0 on a VT100 keypad) maps to the operation associated with frskey8, PF13 (the 1 on a VT100 keypad) activates the first item on the menu line, PF3 activates the second menu item, Control‑E activates the third menu item, Control‑P moves the cursor to the previous field on the form, Right Arrow moves the cursor to the next field, and Delete deletes the character immediately to the left of the cursor. Any previous mappings that do not conflict with these statements remain in effect. (When mapping menu items, the action to be taken after the key is pressed is determined by the application and can differ between applications.)
Notice the effect that including an explicit label has on the appearance of a menu line. Assume a frame's menu includes the following operations:
Help Add Editor End
Assume, also, that the frame containing these menu items also specifies that the Help operation be invoked either by selecting the Help menu item or by pressing the key mapped to frskey8. The previous mapping file example, with its labels, would cause the menu to appear as follows:
Help(0) Add(PF3) Editor(^E) End(4)
Note the case of the Help menu item, which the application also allows to be invoked by frskey8. Two different labels from the map file could be used for this item—1 (the label for the first menu item), or 0 (the label for frskey8). In a case like this, the label for the FRS key always takes precedence over the label for the menu item. All other labels on the menu are those associated with the menu item's position in the menu line.