How to trigger key event taking string name and value in RPN

Hi,
I have been unable to trigger a key event, specifically PANEL_LIGHTS_POWER_SETTING_SET. I have similar issues with the circuit equivalent.

Here, #CIRCUIT# is a given parameter in my template and correctly refers to the name of the circuit to which my panel light is indexed.

(L:#ID#_STATE) (L:#CIRCUIT#_POWER_STATE) * 100 * (>K:PANEL_LIGHTS_POWER_SETTING_SET:'#CIRCUIT#'_n)

formatted per this page.. This refers to Simvars only, presume it is the same for key event triggers?

What is the correct format for this operation? Any chance you could provide an example of a key event trigger which uses the string name with a provided value?

I have successfully used this key event from my WASM module, but for performance reasons I prefer to do this in RPN.

Many thanks,
Chris

Hi @Skylizard8760,

This notation is applicable for SimVars.
For key events, the syntax is the following:

(L:#ID#_STATE) (L:#CIRCUIT#_POWER_STATE) * 100 * '#CIRCUIT#'_n (>K:2:PANEL_LIGHTS_POWER_SETTING_SET)

I’ll make sur we add a note at the end of this page to illustrate when a name is used instead of an index.

Regards,
Sylvain

Thanks Sylvian,
Works perfectly.

I think the confusion came from the link to the Simvars indexing page on the Key Events index:

Many thanks,
Chris

@Nocturne FYI

2 Likes