- Messages
- 527
- Country
-
Hello experts,
I would like to use a key event in my Javascript code. I know how to do this, it is easy. For example, to set the altimeter Kolhsman setting to 1013.25, you can do this:
The problem is that I have several altimeters, with index 1 and 2. If I use the line of code above, it sets ALL the altimeters to 1013.25. What if I want to set only one ?
The doc says a parameter is available for this:
In order to set altimeter #2 only, I tried this:
or this:
Nothing works.
In XML I already did something like:
or
This works, but today I want to do it in Javascript.
Any idea?
I would like to use a key event in my Javascript code. I know how to do this, it is easy. For example, to set the altimeter Kolhsman setting to 1013.25, you can do this:
Code:
SimVar.SetSimVarValue("K:KOLHSMAN_SET", "number", 16125);
The doc says a parameter is available for this:
KOHLSMAN_SET | [0]: Value to set [1]: Altimeter index | Sets altimeter setting (Millibars * 16). | Shared Cockpit |
Code:
SimVar.SetSimVarValue("K:KOLHSMAN_SET:2", "number", 16125);
Code:
SimVar.SetSimVarValue("K:KOLHSMAN_SET", "number", 16125, 2);
In XML I already did something like:
Code:
2 (>K:KOLHSMAN_INC)
Code:
2 (>K:KOLHSMAN_DEC)
Any idea?