Fundamentals > User Interface Basics > Customizing the User Interface > Environment > Working with Mapkey Macros > Example: Creating Nested Mapkeys
  
Example: Creating Nested Mapkeys
You can nest mapkeys so that one mapkey initiates another. To nest a mapkey, include the mapkey name preceded by a percent sign (%) in the sequence of commands of the mapkey you are defining.
The following is an example of an edited mapkey with a nested mapkey. The first line shows the mapkey to be nested, as illustrated in the second line.
mapkey $F1 #VIEW;#PREVIOUS;
mapkey $F2 %$F1;#VIEW;#REPAINT;
 
* Nested mapkeys cannot be more than five levels deep.
This method of calling existing mapkeys is different from the one the system uses when you create mapkeys using the Mapkeys dialog box (File > Options > Environment > Mapkeys Settings).