VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Global Key Command

Global Key Command

This trait adds an action that applies a key command to to other pieces, similar to the Global Key Command component of a Map Window.

Command name:  Name of the right-click menu item
Keyboard command:  Keyboard shortcut of the menu item that initiates the command
Global Key Command:  The key command that will be applied to other pieces
Matching Properties:  The key command will only be applied to pieces with the specified Properties.
Restrict Range: If selected, the command will only apply to pieces located within a specified distance of this piece.
Range:   Only others pieces within this distance, inclusive, of this piece will have the command applied to them.  If the pieces are on a board with a Hex Grid or Rectangular Grid, then the distance is in units of the grid.  Otherwise, the distance is measured in screen pixels.
Fixed Range: If selected, then the range is specified as a fixed number. If unselected, then the range will be given by the value of the named property.
Suppress individual reports:  If selected, then any auto-reporting of the affected pieces will be disabled.  Use the Report Action trait to provide a summary message in their place.

EXAMPLE:  A leader counter and infantry counters both have Marker traits to specify their nationality and type.  A Layer trait represents the rallied state of an infantry counter, uses CTRL A to activate the layer, and uses Rally as the name.  A Global Key Command on the leader counter can select and rally all infantry counters within two hexes of the same nationality that are not rallied by specifying Range=2 and matching properties type=Infantry && nation=$nation$ && Rally_Active=false.