VASSAL Reference Manual

Home > Module > Game Piece Palette > Game Piece > Global Hotkey


Global Hotkey

This trait adds an action that invokes a Hotkey, usually a Keystroke or Named Command for a Toolbar button in the Module window or a Map Window, but it also works for other Hotkeys. For example, you can use it to shuffle a deck via a deck’s "shuffle" Hotkey.

Note
Sometimes you may have a deck of cards or pieces that you want shuffled at the start of the game but not auto-shuffled afterwards. You can use this trait to shuffle the deck during a setup sequence to get your one-time start-up shuffle.

EXAMPLE: A Dice Button component has been added to the Toolbar and assigned the Hotkey F2. A Game Piece is given a Global Hotkey trait with Menu text Roll Dice, Keyboard Command CTRL+R and Global Hotkey F2. Now, selecting the piece and typing CTRL+R or selecting Roll Dice from the right-click context menu will roll the dice button just as if the player had clicked the button in the Toolbar or typed F2 from the keyboard.

Description:

A short description of this trait for your own reference.

Menu command:

Right-click context menu text. If left blank, no context menu item will appear.

Key Command:

A Keystroke or Named Command to initiate the action.

Global Hotkey:

The Hotkey that will be applied. If it is on the Toolbar, then it is the Hotkey assigned to the Toolbar button you wish to activate.

GlobalHotkey When Ctrl+H pressed, send F2 to the Toolbar