Trigger not firing (also, bug in layer dialog)

This is in 3.1.0-svn4979

I have a prototype called “Strength Prototype” which has a numeric dynamic property called “Strength” that starts at 10 and ranges from to 10, with CTRL-[ for decrease and CTRL-] for increase.

I have a prototype called “Flip Prototype” which has:
(1) a layer with two levels - level one has a null image, and level two has a small dot; decrease is CTRL-F, and increase is CTRL-U;
(2) A trigger action that triggers on “Strength<5>4”, watches for CTRL-], and fires CTRL-U (the intent is for the Level 2 dot to disappear when a counter’s strength is increased above 4).

What happens is, the layers can be changed (and the dot appear and disappear accordingly) with CTRL-F and CTRL-U, and the strength decreases and increases with CTRL-[ and CTRL-]; when the layer is at Level 2 (the dot is on), it stays on when strength is decreased but disappears when strength is increased (regardless of the strength’s value); when the layer is at Level 1 (the dot is off), it stays at Level 1. It appears that the CTRL-U trigger is firing (and ignoring the trigger condition), but the CTRL-F trigger is not.

Speaking of keystrokes, here’s a bug: when I enter “f” in the rightmost box of either of the change values in a Layer dialog box, then when I play the module and right-click on a piece, the popup menu shows the key as “Keypad_6”. (Somebody else reported a similar problem with “s” showing up as “F4” - I got that as well. All lowercase letters return either numeric keypad keys or F# keys.)

– Don

The Layer dialog contains some of the oldest code in Vassal and has a couple of unusual ‘features’ that we are going to have to deal with.

It is unique among all of the traits in that the hotkey for Activate, Increase and Decrease is recorded in two parts, the ‘control’ part and the ‘key’ part. If you leave the ‘control’ part blank, then things do not work as you expect. This is a bug that needs to be looked into.

One of the enhancements I would like to introduce soon is ‘Named Hotkeys’ that allow you to specify hotkeys with a name instead of a real hotkey. All components that reference the Named Hotkey will see the same keystoke for the same name, and this keystroke will be guaranteed to be different to all normal hotkeys and all other Named Hotkeys with different names.

However, this is incompatible with the split key definition used for Activate, Increase and Decrease. I need to look into ways we can convert these to a standard key definition.

One of the problems is the ‘key’ part alows you to specify multiple keys for the same command. Does anyone actually use this feature?

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

It’s used in VASL. However, I think you could now achieve the same effect with a combination of multiple Layers and Triggers. We can consider deprecating this feature if it’s blocking the development of Named Hotkeys, which I believe will simplify module development quite a bit.

rk

Post generated using Mail2Forum (mail2forum.com)

I’ve had a bit more of a play with this.

Essentially, The Activate/Increase/Decrease commands in the Layer trait does not support the use of individual printable characters as Key Strokes. You must supply a modifier.

This is the way it has always been and I do not intend to try and ‘fix’ it in version 3.1. As part of 3.2 and the introduction of Named Hotkeys, we will look at ways to change the Layer trait over to using a standard (named) HotKey configurer.

The use of non-modified keystrokes for Key Commands is generally a bad idea as it conflicts with typing in the Chat Window.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

Could we consider blocking Key Commands when the chat window text area
has focus instead? There are some unmodified keystrokes which would be
nice to be able to use (like Delete for deleing pieces).


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Could you elaborate on this a bit more Brent. I am unsure what you mean by
providing a modifier for layer keystrokes. (I’m worried I might do this
without realizing)

Tim

Post generated using Mail2Forum (mail2forum.com)

On Jan 29, 2009, at 2:38 PM, Tim McCarron wrote:

I would expect this means you need to use a modifier key like Control
and not just the key itself. So “Control-D” would work, but just
plain “D” wouldn’t.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Gotcha. Now I understand it with layer. Ok well what Joel suggests would be
cool as use of unmodified keystrokes is very useful (plus Ive had to resort
to them after running out of modified keystrokes) until Named keystrokes can
be implementated.

Post generated using Mail2Forum (mail2forum.com)

You can’t actually use any non-printable characters as the target key in those three fields. Another reason to move towards phasing out thsi mechanism.

Delete is not actually a usable key in any Vassal HotKey configurer - it deletes whatever is in the Configurer.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

I think I new that. It would be nice if you could use Delete, and have a
button with an X on it to clear the configurer.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Good idea. I have a new NameHotKeyConfigurer to replace the existing HotKeyConfigurer to allow entry of both single-key and named hotkeys. I can build the clear button into that.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)