Description

Map of key sequences to command names.

To bind a key to a command, use the Command field keyBinding.

[Command("cube-drop",
description = "Drop a cube into the scene",
keyBinding = "C-d")]
public void CubeDrop() {...}

Or you can use Minibuffer's GetKeymap to reference or create a new keymap. Adding new bindings can be done as follows:

Keymap keymap = minibuffer.GetKeymap("user", true);
keymap["C-d"] = "cube-drop";
keymap["C-c b"] = "randomize-background-color";

Keymaps can be enabled or disabled and they have a priority number. If two enabled keymaps have the same key binding, the one with the highest priority number resolves to its command. A disabled keymap is not considered when resolving key bindings.

Static Public Member Functions

static void BindKey (List< string > keyAccum=null)
 Command bind-key: Bind a key to a command More...
 
static void UnbindKey ([Prompt("Unbind key: ", filler="keybinding")] string keyBinding)
 Command unbind-key: Unbind a key from a command
 

Properties

bool enabled [get, set]
 Keymaps may be disabled. More...
 
int priority [get, set]
 Keymaps are sorted by priority. More...
 
string this[string key] [get, set]
 Get or set the command for the given key sequence. More...
 

Property Documentation

bool enabled
getset

Keymaps may be disabled.

This is the principle means of activating different "modes" in minibuffer.

int priority
getset

Keymaps are sorted by priority.

The higher the priority the greater its precedence.

string this[string key]
getset

Get or set the command for the given key sequence.

E.g.

userKeymap["C-c g"] = "god-mode";