Assign Key [ HP EDIT Reference Manual ] MPE/iX 5.0 Documentation
HP EDIT Reference Manual
Assign Key
Purpose
Assigns a key to a command, or reassigns a key currently assigned to a
command.
Default Syntax
K
Description
This command enables you to:
* Assign a key to a command that does not have a default assigned
key
* Assign another key to a command that has a default assigned key
* Reassign a key currently assigned to a command
You can assign a non-numeric character or non-numeric character preceded
by the Meta key to any HP EDIT command. A non-numeric character preceded
by the Meta key is called a prefixed key.
You can assign several keys to one command if desired, but you cannot
assign one key to several commands.
Command Process
When you execute this command, HP EDIT displays prompts for the following
information:
* The command name
* The key you want to assign to the command
* Whether you want to prefix the key with the Meta key
After responding to the prompts, HP EDIT retains the new key assignment
for the remainder of the editing session. Even after assigning a new key
to a command, the original key assignment for the command still remains
intact for execution. The original key assignment remains until you
reassign this key to another command. For instance, you may decide to
assign the X key to the Assign Key command, which is ordinarily assigned
to the K key. You can then use the K key as well as the X key to execute
the command until you reassign the K key to another command.
[REV BEG]
You cannot assign the following keys to a command because HP EDIT
reserves them for internal use:
^f ^k ^u ^w ^y ^g ^/ ^] ^_
[REV END]
Saving Values Permanently
If you want to save the new key assignment for subsequent sessions, you
can use the Save Config File command, which saves option values and macro
definitions as well as all reassigned keys. You can either:
* Specify a file in which to save the assigned key, then read in the
file using the Load Config File command in subsequent sessions
or
* Save the assigned key to the file EDCONFIG to eliminate reading in
a customized key assignment file when you initiate an editing
session.
Procedure
To assign a key to a command:
1. Press the K key. HP EDIT displays the prompt Command: on the
message line. If you decide that you do not want to reassign a
key, simply press Return. HP EDIT then cancels the command and
returns the cursor to its former location in the file.
2. Type the name of the command to which you want to assign or
reassign a key and press Return. HP EDIT displays the prompt Key
to assign: on the message line.
If you specify an invalid command name, HP EDIT sounds the
terminal bell. In order to proceed, you could use the Backspace
key to delete the incorrect characters and then retype the
command.
3. Press the key you want to assign to the command. HP EDIT does not
display the key you just pressed, but displays the prompt Is key
prefixed by Meta? on the message line.
4. Press either the y key (yes) for prefixed or the n key (no) for
non-prefixed. If you press the y key, HP EDIT displays the
message Meta-x:Command Name where x represents the assigned key
prefixed by the Meta key ([ESC]). If you press the n key, HP EDIT
displays the message x:Command Name, which indicates that the
assigned key is not prefixed.
Example
To assign the q key to the Exit command and permanently save the
assignment to the default EDCONFIG configuration file:
1. Press the K key. HP EDIT displays the following prompt on the
message line:
Command: _
2. Type exit and press Return. HP EDIT displays the following prompt
on the message line:
Key to assign: _
3. Press the q key. HP EDIT displays the following prompt on the
message line:
Is key prefixed by Meta? _
4. Press the n key. HP EDIT returns the cursor to its previous
position in the file and displays the following message on the
message line:
q:Exit
5. Execute the Save Config File command by pressing ESC, then
pressing the s key. HP EDIT displays the following prompt on the
message line:
Press CTRL-Y to cancel. Save configuration to EDCONFIG
6. Press the Return key. HP EDIT momentarily displays the following
message on the message line:
Saving EDCONFIG...
After this file is saved, HP EDIT automatically reads in this key
assignment at the start of subsequent HP EDIT sessions.
Related Commands
Insert All Key Assignments
Reset All Key Assignments
Reset Key Assignment
Show All Key Assignments
Show Key Assignment
Show Reassigned Keys
MPE/iX 5.0 Documentation