Arbortext Command Language > Commands > map
  
map
map [ window | all] keyname { cmd1 | { cmd1; [ cmd2; …]}}
This command assigns command functions to keyboard characters and mouse buttons for the window specified. The value for window, which is a window class name or user-defined keyboard shortcut, can be any of the following:
edit, which designates the Edit pane.
cmd, which designates the command line.
helpwin (also called helpwin1), helpwin2, helpwin3, helpwin4, msg (also called msgwin1), msgwin2, msgwin3, and msgwin4 designate multiple Help windows. Use msgwin for Arbortext Editor messages and output from the show, eval, and similar commands.
window name as returned by the window_name function.
@name, which designates the name of a user-defined keyboard shortcut.
If window is a class name, the mapping affects all windows using the specified class keymap, otherwise it changes the mapping in the keymap defined by a previous define_keymap or copy_keymap command.
A list of several window classes can be made by using a plus sign (+) to separate the names. To subtract a window class from a list, use a hyphen (-). The option all is a synonym for edit+cmd. Note that the helpwins and msgwins are not included in the all option. To map a key for all possible window classes, use: map all+textwins. The textwins option is a synonym for helpwins+msgwins. The helpwins option is a synonym for helpwin1+helpwin2+helpwin3+helpwin4. The msgwins option is the same as msgwin1+msgwin2+msgwin3+msgwin4.
The default keymap is the one attached to the current window (normally the edit class user keymap).
The value for keyname can be any one of the following:
any of the letters a-z or A-Z,
any of the punctuation characters on the keyboard,
any of the digits 0-9,
any of the function keys F1, F2, ... F35
Synonyms, or alternate key names, are in parentheses. Keypad can be replaced by KP or Num (for example, KP_9 is equivalent to Keypad_9).
any of the keypad keys:
Punctuation Characters On the Numeric Keypad
Symbol
Name
Synonym
(
Keypad_ParenLeft
Num_(
)
Keypad_ParenRight
Num_)
*
Keypad_Multiply
Num_*
+
Keypad_Add
Num_+
,
Keypad_Separator
Num_,
-
Keypad_Subtract
Num_-
.
Keypad_Decimal
Num_.
/
Keypad_Divide
Num_/
=
Keypad_Equal
Num_=
any of the following name keys.
Abort (Stop)
LineFeed
Again (Redo)
Mark (Select)
Alternate
Move
BackSpace
MultiKey
BeginLine
Next
Break
NextScreen (Next)
Cancel (Stop)
NextWindow (Next)
CharDel (DeleteChar)
NextWndo (Next)
Clear (ClearDisplay)
NumLock
ClearDisplay
PageDown (Next)
ClearLine
PageUp (Previous)
CmdKey
Paste
Compose
Pause
Copy
PF1
Cut
PF2
Del (Delete)
PF3
Delete
PF4
DeleteChar
PgDn (Next)
DeleteLine
PgUp (Previous)
Do (Menu)
Pop
DownArrow
Prev
DownBox
PrevScreen
Edit Key
Previous
End (EndLine)
Print
EndLine
Prior (Previous)
Enter (Return)
R1, R2, ... R16
Esc (Escape)
Read
Escape
Redo
Execute
Remove
Exit
Repeat
F1, F2, ... F10
Reset
F11, F12, ... F20
RightArrow
F21, F22, ... F35
RightBox
Find
Save
Grow
Select
Hold (Pause)
Shell
Help
Space
Ins (Insert)
Stop
Insert
System
InsertHere (Insert)
Tab
InsertLine
Undo
LeftArrow
UpArrow
LeftBox
UpBox
LineDel (DeleteLine)
User
LineDelete (DeleteLine)
* 
Remapping the ENTER key at the command line can make it impossible to execute further commands. However, you cannot remap CONTROL+SHIFT+ALT+ENTER , which can always be used to execute commands at the command line.
Commands can also be mapped to the mouse buttons. M1 and M2 designate the left and right mouse buttons on a two-button mouse. On a three-button mouse, M2 is the middle button and M3 is the right button. However, to use a three-button mouse on Windows, you also need to set the environment variable APTMOUSE to equal 3. Any of the shift or control sequences may be used with any mouse button. In addition, the designation for the mouse button may be prefixed with Up-, Double-, or Triple- where:
Up maps a command to the release of the designated mouse button (commands not prefixed by “Up” are executed when the button is first pressed down)
Double maps a command to the second click in succession of the designated mouse button
Triple maps a command to the third click in succession of the designated mouse button
The map command accepts the abbreviations ctrl for Control, dbl for Double, and trpl for Triple. Note that mouse commands are additive; thus, before a command mapped to the third click of the right mouse button (Triple-M3) is executed, any commands mapped as M3, Up-M3, Double-M3 and Up-M3 would be executed, followed by Triple-M3 and finally Up-M3.
Commands can further be mapped to scroll wheel actions with scrollwheel. You must preface scroll wheel actions with either down or up to indicate whether the action is for scrolling the wheel down or up. For example, down+scrollwheel indicates the mapped command is triggered by scrolling the wheel down.
Examples
map BackSpace caret 0,-1
map all f1 caret next
map shift-f2 print unformatted screen \
header=none
map control-shift-alt-q quit ok
map control-d delete_character
map shift-alt-d {caret 0,+1; delete_character;}
map shift-M3 {caret mouse; menu;}
map shift-M1 caret mouse
map @mymap Control-y paste
map Double-M3 help
map all+textwins-cmd shift-UpArrow window -1,0
map all+textwins down+mousewheel ScrollWheelDown
map all+textwins down+mousewheel ScrollWheelDown
map all+textwins up+mousewheel ScrollWheelUp
map edit+textwins control+down+mousewheel ZoomDown
map edit+textwins control+up+mousewheel ZoomUp
Related Topics
alias command
Command variables
execute command
menu_add command
readvar command
show variables command
Symbolic parameters
unmap command