Create account / Log in

Global keyboard shortcut or button

Talk about module design ideas and techniques.

Moderators: Tim M, uckelman

Global keyboard shortcut or button

Postby mroyer » March 23rd, 2011, 2:24 pm

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.
mroyer
 
Posts: 166
Joined: March 4th, 2011, 5:06 pm
Location: Massachusetts

Re: [messages] Edit: [Module Design] Global keyboard shortcu

Postby Tim M » March 23rd, 2011, 2:46 pm

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
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:
viewtopic.php?p=22360#p22360
Tim,
Vassal Uber Geek/Guru

Problems? post your OS, Physical Mem, version of Vassal and Java plus the Module in question.
No developer can help with out that info, thx!
User avatar
Tim M
 
Posts: 1777
Joined: December 8th, 2007, 12:22 pm
Location: Earth

Re: Global keyboard shortcut or button

Postby mroyer » March 23rd, 2011, 3:07 pm

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.
mroyer
 
Posts: 166
Joined: March 4th, 2011, 5:06 pm
Location: Massachusetts


Return to Module Design

Who is online

Users browsing this forum: No registered users and 3 guests