Assigns a command to a logical key.
Scope: File
Syntax
query action.[prefix.]KeyName
set action.[prefix.]KeyName [Command]
Options
Command |
Command which may include the mult command. If Command is omitted, the key is set to its default action, which is to return its own value. | ||||||||||||||||||||||||||||||||||||||||||||||||
prefix |
If this option is specified, the key is active only when the cursor is in the prefix area. | ||||||||||||||||||||||||||||||||||||||||||||||||
KeyName |
Your operating system may reserve
certain function keys or key combinations, such as F1,
for special purposes. With these exceptions, permitted
values for KeyName are:
|
Description
The action parameter assigns a command to a logical key for the current file only. When the assigned key is pressed, the command is carried out, provided the actions parameter is on. A multiple command can be attached to a key using the mult command.
This parameter can be used to override previously defined accelerators. If the accelerator was advertised on a menu, it would now be incorrect. To change the accelerators displayed for a menu item, use the set actionbar command.
| Note: | The case of the key assigned to an action is ignored when used in combination with the Alt or Ctrl keys. |
Examples
set action.a-8 add 8
Pressing Alt+8 now adds eight lines to the file.
set action.f7 scroll screen up
set action.c-w ;block set clear word ;block delete
The first ; is a synonym for the mult command. Actions assigned to a key work much like commands typed on the command line; synonyms are processed; macros and external commands can be used.
set action.a-m macro block
If the word macro is omitted, the Alt+m key issues the built-in block command. Adding the word macro ensures that the Editor searches instead for a macro named block.lx.
set action.button1drag ;primitive setcursor ;block mark character
This dynamically marks the block. The first command, primitive setcursor, makes the Editor move the cursor to the position of the mouse pointer. The second command makes the Editor extend (or shrink) the current block to include the character at the cursor position.
API Return Codes
-1 |
The number specified was not a positive integer. Issue the command again using a valid positive number. |
-2 |
The option specified with the parameter was not valid. Check the syntax requirements for the parameter and try the set or query command again. |
![]()
actionlist Parameter
accelerator Parameter
actions Parameter
prefixshow Parameter
List of Primitive Functions
