Javascript API support dual index K events

Could the JS API be updated to support K events with double Indexes. Theses
new Double Index K events are supported in XML, but currently do not seem to
be supported in JS ? (are they supported in WASM ? ) If they are , what is the
correct format ?? I can find no description or examples in the SDK, or any
current aircraft.

UPDATE: DONE- Thanks

You can trigger these with the KeyEventManager in the avionics framework Class: KeyEventManager | MSFS Avionics Frameworks and Instruments

That idea was needing an update indeed.

In JS, the “TRIGGER_KEY_EVENT” Coherent call lets you pass up to 3 arguments.

In WASM, you can either use execute_calculator_code and provide RPN code
execute_calculator_code (flightsimulator.com)

or use trigger_key_event_EX1 that can take up to 5 arguments
trigger_key_event_EX1 (flightsimulator.com)

Regards,
Sylvain

@FlyingRaccoon is there a basic working example of the JS Coherent call using TRIGGER_KEY_EVENT? I spent some time experimenting with trying to do this last week, with no success. I am successfully using JS Coherent calls to intercept key events, but I had no luck in using the same basic JS structure to trigger key events.

Hello @MVJimStewart

I could find an example on Glider instruments.
AS9070.js has the following call for example:

Coherent.call('TRIGGER_KEY_EVENT', 'KOHLSMAN_SET', true, qnhSetting * 16, 1, 0);

The call expects:

  • the key event name
  • a boolean “bypassIntercepts” to define if event callbacks are to be called or skipped
  • the 3 possible arguments, in this example the qnh, the altimeter index and a third one that is not used.

Regards,
Sylvain

@FlyingRaccoon - thanks for the reference & explanation!

No, WASM has the same issue at the moment… S.

I don’t know if we mean the same thing, but in WASM you can actually use
execute_calculator_code to trigger those dual stack K:Events. Not the nicest
of ways for sure, but it works. Greets, Ben

The trigger key events modules only supports 1 parameter. We are asking for
this to support 2, I rather not use execute calculator code, trying to keep
performance at max in my wasm modules. S.

Sure! Just that it actually is possible already ;).

but it is not really native…

Bumping this - no comment from ASOBO if this is in future plans

A workaround will be to use SetSimvarValue to set 2x L: variables, and use
these in a model XML “Update” block to drive the intended dual-input K event.
That said, updating the JS functions to support the 2-value K events will be
the best thing.

That’s what we ended up doing, when 2-k events were introduced, , but a native
JS solution would be far cleaner.

which got introduce some time after the above post … Thank you Asobo.