Functions documented to take a parameter of type Keymap are special. In place of the keymap parameter, you specify the name of the keymap, as a symbol (not as a string!), for example,

 Key(Global, "Alt-X")

This special behaviour is only available for elementary functions and commands. You cannot write functions or subroutines that take Keymap parameters.

Keymaps have a separate namespace from variables, i.e. a keymap MyStuff and a variable MyStuff are not related in any way.

A keymap contains a set of keystrokes and commands active in a particular context. A keymap can have one or more parent keymaps that "extend" the keymap. A key is looked up first in the keymap itself. If it is not found there, it is searched for in the parents.

PCC predefines a set of keymaps. Those are listed below as "properties". You can define your own keymaps using CreateKeymap, manipulate them using Bind, and use them using UseKeymap.

Since 2.0.8, you can also specify keymap names as an expression using the ByName() pseudo-function:

 Bind ByName(n) "x" := "My.Command"

Here, the name of the keymap is specified in variable n.

Predefined keymaps are defined a little different between PCC 1.x and PCC2. The following overview applies to PCC2 and, where appropriate, also for 1.x.

Global(Base for all predefined keymaps)
ShipWhenever a ship is active.
PlanetWhenever a planet is active.
BaseWhenever a base is active.
FleetWhenever a fleet is active.
ControlScreen(Global)Active on all control screens.
ShipScreen(Ship, ControlScreen)Active on ship screen.
PlanetScreen(Planet, ControlScreen)Active on planet screen.
BaseScreen(Base, ControlScreen)Active on base screen.
FleetScreen(Fleet, ControlScreen)Active on fleet screen.
HistoryScreen(ControlScreen)Active on ship history screen.
AutoTaskScreen(ControlScreen)Active on auto task screen.
Starchart(Global)Active on starchart.
ShipLock(Ship, Starchart)Active when a ship is selected in the starchart.
PlanetLock(Planet, Starchart)Active when a planet is selected in the starchart.
UnknownPlanetLock(PlanetLock)Active when an unknown planet is selected in the starchart.
BaseLock(Base, Starchart)Active when a base is selected in the starchart.
RaceScreen(Global)Active on race screen.

Commands and Functions taking Keymap as Parameter

Functions returning Keymap

Properties of type Keymap