Global Key Command question

A GKC property key command issued is applied to OTHER pieces, right?

I want to test for duplicates, so the piece issues a GKC (say SHIFT 1) matching: BasicName = $BasicName$. When the duplicate gets this keystroke(Trigger on SHIFT 1), it replies with its own GKC (SHIFT 2) matching: BasicName = $BasicName$. Finally, there is a trigger that responds to SHIFT 2 by issuing a Delete keystroke.

When I test this piece, it deletes itself even though there are no other pieces on the board. Thus I conclude that it is issuing the GKC to all pieces including itself.

Is there a way to exclude itself in the global issue?

Thanks,

Flaney

On May 27, 2011, at 3:33 AM, Flaney wrote:

A GKC property key command issued is applied to OTHER pieces, right?

No. It is issued to all pieces. That is why it is called Global.

I want to test for duplicates, so the piece issues a GKC (say SHIFT 1)
matching: BasicName = $BasicName$. When the duplicate gets this
keystroke(Trigger on SHIFT 1), it replies with its own GKC (SHIFT 2)
matching: BasicName = $BasicName$. Finally, there is a trigger that
responds to SHIFT 2 by issuing a Delete keystroke.

When I test this piece, it deletes itself even though there are no
other
pieces on the board. Thus I conclude that it is issuing the GKC to all
pieces including itself.

Is there a way to exclude itself in the global issue?

I think that what you would need to do is:

  1. set a dynamic property tester on the piece itself with any, say
    “SELF”
  2. Make the match test be for
    BasicName = $BasicName$ & tester != SELF
    [Not sure about the exact syntax]
  3. Do your deletion
  4. remove the dynamic property test = SELF

Just tonight I utilized a similar method. The piece tests for matching names not in the same hex (my units have a stack limit if one). This required an additional match because the piece being brought to the map had its current location still attached to the AtStart window map name.

But, yeah, GCK’s affect all pieces including themselves (contrary to the reference guide).

flane