Global keyboard shortcut or button

I did some searching but haven’t spotted how to do this:

How can a button or “global” keyboard shortcut be assigned to a trait of all pieces?

For example, I have an area of effect assigned to units with zones of control. A keyboard shortcut can toggle a visible shading of the area for each piece separately. I’d like to have a button or keyboard shortcut (or both) to toggle on/off area-of-effect shading for all pieces at once.

Thanks for any help,
-Mark R.

Lets say your visible shading uses the keyboard shortcut Ctrl A and you only
have one map called “Main Map” (the default name)

In the editor you would add a toolbar GKC (right clcik top of module tree and
select option “add Global Key Command”

Description field - A button that turns on/off visible shading for all pieces
Key Command - Ctrl A
Matching Properties - CurrentMap = Main Map
Within a Deck apply to - No Pieces
Button Text - Visible Shading
Tooltip text - same as description field
Button Icon - image your choice or leave blank
Hotkey - leave blank
Suppress individual reports? check mark on
Report format - whatever you want it to say

The important things are the Key Command field (must match) and the Matching
Properties field (you need to apply the effect against something). It doesnt
necessarily have to be against the map for example - it could be a defined
marker traits on pieces or it could be a zone / board / location, even a layer
level etc… but that is getting more in depth. For your purposes a marker trait
or a map is easiest to use


From: mroyer mroyer1@comcast.net
To: messages@vassalengine.org
Sent: Wed, March 23, 2011 9:25:07 AM
Subject: [messages] Edit: [Module Design] Global keyboard shortcut or button

[This message has been edited.]

I did some searching but haven’t spotted how to do this:

How can a button or “global” keyboard shortcut be assigned to a trait of
all pieces?

For example, I have an area of effect assigned to units with zones of
control. A keyboard shortcut can toggle a visible shading of the area
for each piece separately. I’d like to have a button or keyboard
shortcut (or both) to toggle on/off area-of-effect shading for all
pieces at once.

Thanks for any help,
-Mark R.


Read this topic online here:
https://forum.vassalengine.org/t/global-keyboard-shortcut-or-button/3778/1

Thanks Tim!!
It worked perfectly.

I need to study it a bit further to understand fully how it works - I think I was misunderstanding how the key-command field was working; it seems not to define the key for the global action, but instead defines the key for which the button should emulate for every piece, globally… I think.

Anyhow, thanks again.