trigger_key_event_EX1() not working on first use (but OK on subsequent uses)

Version: 1.2.8.0

Frequency: Consistently

Severity: High

Context: Custom standalone WASM module built for MSFS 2020 (SDK v.0.24.3) installed in MSFS 2024 Community folder.

Similar MSFS 2020 issue: None, works as expected in 2020.

Bug description:

Invoking Gauge API trigger_key_event_EX1() doesn’t seem to have any effect the first time after Sim has been started.

Every subsequent invocation works as expected. Even if the WASM module is reloaded (eg. rebuilt from project manager). Seems specifically after first start of simulator itself.

Repro steps:

  1. Load a standalone WASM module which calls trigger_key_event_EX1(65752, 0, 0, 0, 0, 0) (on demand somehow or twice after a flight has started). This ID is for the PARKING_BRAKES event (toggle parking brakes).
  2. Load a freelight with a stock Cessna 172, starting on a runway.
  3. Either trigger the trigger_key_event_EX1() call in the WASM module somehow or wait for it to trigger twice.
  4. Observe that the first call seems to be ignored, meaning the parking brake state doesn’t change. Subsequent calls work fine.

OR

  1. Download/install WASimModule and WASimUI assets from WASimCommander Releases
  2. Start simulator, load into a flight with C172 on runway, as above.
  3. Start WASimUI, hit the “Connect” button at top left, then use “Key Events” section to send a PARKING_BRAKES event.
    This ends up invoking void sendKeyEvent() in the module’s code (which then uses trigger_key_event_EX1()).
2 Likes