Wing ships with several key equivalency maps found at the top level of the Wing IDE installation, including keymap.normal, keymap.emacs, keymap.vi, and others. These are used as default key maps for the corresponding editor personalities, as set with the User Interface > Keyboard > Keyboard Personality preference.
For developing entirely new key bindings, or in other cases where the Custom Key Bindings preference is not sufficient, it is possible to create a custom key equivalency map and use it as your default map through the Key Map File preference.
In a key map file, each key equivalent is built from names listed in the Key Names section. These names can be combined as follows:
- A single unmodified key is specified by its name alone, for example 'Down' for the down arrow key.
- Modified keys are specified by hyphenating the key names, for example 'Shift-Down' for the down arrow key pushed while shift is held down. Multiple modifiers may also be specified, as in 'Ctrl-Shift-Down'.
- Special modifiers are defined for Vim mode: Visual, Browse, Insert, and Replace. These correspond with the different editor modes, and will only work if the Keyboard Personality preference has been set to VI/Vim.
- Multi-key combinations can be specified by listing multiple key names separated by a space. For example, to define a key equivalent that consists of first pushing ctrl-x and then pushing the a key by itself, use 'ctrl-x a' as the key sequence.
The command portion of the key equivalency definition may be any of the commands listed in section Command Reference. See the examples below for usage options.
Here is an example of adding a key binding for a command. If the command already has a default key binding, both bindings will work:
'Ctrl-X P': 'debug-attach'
This example removes a key equivalent entirely:
'Ctrl-C Ctrl-C': None
These can be combined to changes the key binding for a command without retaining its default key binding:
'Ctrl-C Ctrl-C': None 'Ctrl-G': 'debug-continue'
Wing always retains only the last key binding for a given key combination. This example binds Ctrl-X to 'quit' and no other command:
'Ctrl-X': 'debug-stop' 'Ctrl-X': 'quit'
If multiple commands are specified separated by commas, Wing executes the first command that is available. For example, the following will either restart the debug process whether or not one is currently running:
'Ctrl-X': 'debug-restart, debug-continue'
Command arguments can be specified as part of the binding. Any unspecified arguments that do not have a default will be collected from the user in a dialog or in the data entry area at the bottom of the IDE window:
'Ctrl-X P': 'show-panel(panel_type="debug-probe")'
If Keyboard Personality is set to VI/Vim, modifiers corresponding to the editor modes restrict availability of the binding to only that mode:
|« 2.0.0. Key Equivalents||Table of Contents||2.0.2. Key Names »|