[SU11] WASM trigger_key_event_EX1 only supports positive values

Dear Asobo, The trigger_key_event_EX1 function only allows UINT32 values to be
passed for the event:

      1. trigger_key_event_EX1(
  2.     ID32  event_id,
  3.     UINT32 value0,
  4.     UINT32 value1,
  5.     UINT32 value2,
  6.     UINT32 value3,
  7.     UINT32 value4
  8.     );

However there are certain events that requires to receive a negative value,
for example the axis throttle events, the propeller axis events, and others:

I tried to flip the value using
the UINT trick of taking the number I wanted to pass and remove 4294967295
from it but this results in a value of zero in the simulator. This limitation
prevents sending certain events to complete customs simulations and behaviours
in the sim. Best Regards, Raul

Hi, Yes, trigger_key_event_EX1 has unsigned value (because of legacy reasons).
But, those values must be interpreted as “32 bit buffer” not necessary UINT32.
That means that a negative value can be given to this function if the given
KeyEvent supports it. So using

      1. trigger_key_event_EX1(KEY_AXIS_PROPELLER_SET, -1);

will lead to So, check the
documentation to know what kind of value you can use with each KeyEvents
(signed int32, unsiged int32, float32…) Best Regards Maxime / Asobo

Hi @Arzop Thanks for help, ok what value you need to
pass to make the Lever Position negative? I need to place the Prop Lever
Position axis as -16383, or -100 percent to force the props to feather. In
Addition, in your example, if you execute that event via RPN code, -1
(>AXIS_PROPELLER_SET) the variable lever position would set the axis as -1…
not as 49% the value of the axis is from -16383 to 16383 so 49% is something
in the middle of these 2 values. In addition if you execute the code -1
(>GENERAL ENG PROPELLER LEVER POSITION:1, percent) is will also go negative as
-1 percent. What I failed to do via WASM was to achieve any negative results
on the lever via the trigger_key_event_EX1… for GENERAL ENG PROPELLER LEVER
POSITION:1 the result in the sim is always from 0 to 16383 which is wrong
since this variable accepts negative values… same for the throttle which can
go in reverse. Hope this helps to show case the issue I am experiencing. Best,

Hi Raul, Are you saying that thew new trigger_key_event_EX1() acts differently
from all the other ways of sending event data values? trigger_key_event(),
send_key_event(), the SimConnect TransmitClientEvent*() functions (in both C++
and C# )… all take uint32 arguments. As Arzop mentioned, it’s just a memory
container. Am I missing something? Cheers, -Max PS. -1 expressed as a uint32
is 0xFFFFFFFF. A simple C-style cast takes care of the conversion, eg:

Hi, The new function trigger_key_event_EX1 works as the same way as
trigger_key_event. The only difference is the number of arguments.
trigger_key_event is a FSX function which was sufficient at this time but in
MSFS, we’ve added new key events (with more than one argument) and we needed a
new function to trigger them. But the internal process is the same. About
those two key events, there might be something wrong with the way we have to
set them. Best Regards Maxime / Asobo

@Arzop , Thanks for the reply, I still unable to set the pro lever into
negative from WASM, so I will wait for your internal tests and advice on this
one. Best Regards, Raul

Hello @Simbol Can you try passing -16383 to
PROP_PITCH_SET? That should give a prop pitch of -100% Regards, Sylvain

ok will try tonight and revert back with the results… Best, Raul