• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX What Command "Toggles" Require "Input?"

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
A few days ago the question came up about certain command events (>K:xxx_toggle_xxx) require "input" to control separate (A:var,unit) token variables.

Here is the bare beginning of such a list:
Code:
n (>K:HYDRAULIC_SWITCH_TOGGLE) // Toggle Engine n Hydraulics on/off
n (>K:ANTIDETONATION_TANK_VALVE_TOGGLE) // Toggle Engine n AntiDetonation on/off
n (>K:NITROUS_TANK_VALVE_TOGGLE)
n (>K:SMOKE_TOGGLE) [Best to use n (>K:SMOKE_ON) and n (>K:SMOKE_OFF)]
ident# (>K: PANEL_ID_TOGGLE) // pass the panel ident number
n (>K:TOGGLE_AUTOFEATHER_ARM) // Toggle Engine n Prop Autofeather Arm on/off
I'm going to go out on a limb here and suggest that any "toggle" type event that has multiple token variables associated with the event will require input to function correctly on them.

Nonetheless, the above are the only one's I've personally tested, so if anyone else knows for certain of any that aren't listed, post 'em here so I can keep this list updated!
 
Last edited:
PANEL_ID_TOGGLE, where you need to assign the ident of the panel [Window] that is toggled into view.
 
Last edited:
Hi Bill,

The ESP SDK mentions these that require an index be passed to them: ANTIDETONATION_TANK_VALVE_TOGGLE and NITROUS_TANK_VALVE_TOGGLE

Bob
 
Last edited:
Code:
1 (>K:TOGGLE_AUTOFEATHER_ARM) // Toggle Engine 1 Prop Autofeather Arm on/off
2 (>K:TOGGLE_AUTOFEATHER_ARM) // Toggle Engine 2 Prop Autofeather Arm on/off

Hi Bill ... another question ... can you help me out with TOGGLE_AUTOFEATHER_ARM? I can't get it to take an index.

My takeaway from that old thread, "Interaction of 3D switches and 2D gauges...what?" was that TOGGLE_AUTOFEATHER_ARM was non-indexed and that it affected all (A: PANEL AUTO FEATHER SWITCH:n, bool), with any index, and did not affect (A: PROP AUTOFEATHER ARMED:n) at all. A bit confusing.

Thx,

Bob


Note: old thread was FS9, my test was FSX, my aircraft.cfg has
prop_feathering_available=1
prop_auto_feathering_available=1


the space between A: and P above, is to prevent A:p
Arno .......
 
Last edited:
My takeaway from that old thread, "Interaction of 3D switches and 2D gauges...what?" was that TOGGLE_AUTOFEATHER_ARM was non-indexed and that it affected all (A: PANEL AUTO FEATHER SWITCH:n, bool), with any index, and did not affect (A: PROP AUTOFEATHER ARMED:n) at all. A bit confusing.
Indeed it is not. Funny that I did have it working once, but today nothing I tried would get it working. Hence I've now removed from the top post and crossed it out in red to make it clear.
 
Here's another one for you, Bill. Perhaps it just shows my ignorance of FSX XML schema because I use only FS9 XML schema even for FSX work.

I have always omitted the letters 'KEY_' when writing a K Event in XML. The Event ID KEY_ADF_CARD_SET in XML would be ADF_CARD_SET and an example command would be 200 (>K:ADF_CARD_SET).

So, what's up with this explanation which is from the ESP SDK Creating XML Gauges:

Key Parameters (K: )
Key parameters can be used to trigger key events. Key parameters must be used if a value needs to be sent with the key event. For example, to set the ADF card to a specific value of 200, use the following syntax:
200 (>K:KEY_ADF_CARD_SET)
For more a list of events that can be used with Key Parameters see the Event IDs document. Note that unit names are not used with these parameters, however the > is still required even it the key event does not take a numeric parameter.

Just another mistake?


Thx,

Bob
 
Yes Bob, that is a rather egregious mistake! I'll have to double-check the P3D SDK's to see if that mistake has been corrected.

What is confusing to many folks is that the EventIDs document lists the C code KEY_ events in the left column, and the XML equivalents in the second column, and the "titles" at the top of the columns aren't really clear as to which is which...

I don't include the _SET type events in my list because they always require input!
 
Bob,

As Bill stated, it's another SDK mistake.

Actually C++ and XML Key parameter names are not the same thing, despite both use a similar description.

C++ Key parameters are macro defines detailed in gauges.h, each macro representing an exclusive hex number.
XML event names are properties within an Event class, each one probably related to the same hex number.

Now, in you example of KEY_ADF_CARD_SET, you could freely change that in gauges.h for a name of your choice.
Instead of:
Code:
#define KEY_ADF_CARD_SET                (KEY_ID_MIN + 503)

You could write this:

Code:
#define MY_ADF_CHANGE                (KEY_ID_MIN + 503)

So, when firing the event in C++, instead of :
trigger_key_event (KEY_ADF_CARD_SET, 200)

you must now write:
trigger_key_event (MY_ADF_CHANGE, 200)

to obtain the same result.

However, if you write:

200 (>K:MY_ADF_CHANGE)

Nothing will happen.

Tom
 
Back
Top