Jump to content
The simFlight Network Forums

Listing Aircraft Input Events


LeoSchoonbroodt

Recommended Posts

Hi John,

First of all, i wish you and yours a Merry Christmas.

If you somewhere find the time, maybe in the new year, could you tell me if there is a way to list the Airplane Input Events that you query at start of the flight.

I have some AAO's RPN scripts from a guy who claims those will work, and indeed most of it works, except the buttons are not animated and i understood from him that this should be accomplished by the Input Events. also present in the script.
So i expect there is something in the naming of the event. 

As example below script works except for the animation of the knob if i fill the Lvar Source.
I increment or Decrement the InstrumentsLight variable by turning a rotary encoder.

ipc.writeLvar("L:Alouette III SA316B-INSTR_LIGHTS_AXIS", InstrumentsLight)
  ipc.execCalcCode("(L:Alouette III SA316B-INSTR_LIGHTS_AXIS) d d (>K:LIGHT_POTENTIOMETER_2_SET) (>L:LIGHTING_PANEL_1) (>B:LIGHTING_PANEL_1_SET)")

If i try an increment also no animation and an errormessage

ipc.execInputEvent("B:LIGHTING_PANEL_1_Inc", 1)

I wanted to list the available Input events for the plane but see no possibility for that, maybe its my lack of knowledge about Input Events that's the problem and the guy who provided me with the scripts tells me it's working.

Thanks for any help and a Merry Christmas

Leo

EDIT
Sorry to bother you with this one John found how i can find the available Input events via the Behavior window of develper Mode and also the log menu provides the possibillity to list them, i was looking in the Add-ons menu as this is were i can also list Lvars and Hvars.
Alo found that i can't access Input events via calculatorCode, so this explains why the upper code does only partially work.
Still baffled why this ipc.execInputEvent("B:LIGHTING_PANEL_1_Inc", 1) doesn't work as the Input Event exists and i am using the syntax from the lua library.

 
Link to comment
Share on other sites

On 12/24/2023 at 5:47 PM, LeoSchoonbroodt said:

...Still baffled why this ipc.execInputEvent("B:LIGHTING_PANEL_1_Inc", 1) doesn't work as the Input Event exists and i am using the syntax from the lua library.

 

I also cannot get it to work.

 

Karl

Link to comment
Share on other sites

7 hours ago, kaha said:

Was my fault, works now. The reason it didn't work was that I used a wrong parameter.

Good for you, I stopped looking for a solution as i was flying another Heli.
Would you mind sharing your Code?
If you say you used a wrong parameter, i can only imagine 0 or 1 as parameter as it's an Inc and not a Set.

 

Link to comment
Share on other sites

27 minutes ago, LeoSchoonbroodt said:

Good for you, I stopped looking for a solution as i was flying another Heli.
Would you mind sharing your Code?
If you say you used a wrong parameter, i can only imagine 0 or 1 as parameter as it's an Inc and not a Set.

 

Test your input event with the button assignments and then take a look at the input events list from the log menu. Use this for the lua script.

In my example I use input event ELECTRICAL_Battery_1. Here is the lua script:

--[[

	Battery 1 for Caribou
	
	1 = on
	0 = off
	
]]

ipc.execInputEvent("ELECTRICAL_Battery_1", ipcPARAM)

Is your input event really named B:LIGHTING_PANEL_1_Inc? The input events I see in my aircraft don't start with B:

...
DHC4_ENGINE_Propeller_1<>
DHC4_ENGINE_Propeller_2<>
ELECTRICAL_Alternator_1<>
ELECTRICAL_Alternator_2<>
ELECTRICAL_Battery_1<;FLOAT64>
ENGINE_Throttle_1<;FLOAT64>
ENGINE_Magneto_1<>
...

 

InputEventsButton.png

Link to comment
Share on other sites

Hi,
thanks for the response, this B: could be the problem i think.
I just used the eventname as it was used in the script i got from a friend, and always only used lua, so never used the button & switch assignment menu. 
Will give your method a try as soon as i am at my PC again.

thanks again, will let you know if it worked

Leo

Link to comment
Share on other sites

On 12/28/2023 at 6:40 PM, kaha said:

Test your input event with the button assignments and then take a look at the input events list from the log menu. Use this for the lua script.

In my example I use input event ELECTRICAL_Battery_1. Here is the lua script:

--[[

	Battery 1 for Caribou
	
	1 = on
	0 = off
	
]]

ipc.execInputEvent("ELECTRICAL_Battery_1", ipcPARAM)

Is your input event really named B:LIGHTING_PANEL_1_Inc? The input events I see in my aircraft don't start with B:

...
DHC4_ENGINE_Propeller_1<>
DHC4_ENGINE_Propeller_2<>
ELECTRICAL_Alternator_1<>
ELECTRICAL_Alternator_2<>
ELECTRICAL_Battery_1<;FLOAT64>
ENGINE_Throttle_1<;FLOAT64>
ENGINE_Magneto_1<>
...

 

InputEventsButton.png

Finally found some time to test without the B: and it didn't work either altough the event is listed.
So decided to test another event in another plane, to make sure i understand how to do it, and to my supprise, that works.
Tried it with Button assignment and thereafter also in my lua script, both work.

So i went back to the original LIGHTING_PANEL_1_Inc event and tried this via Button assignment to no result.
EDIT: See now that i tried the found LIGHTING_PANEL_1 , so without the Set or Inc. See my post below.
Have given up on this, costs to much flying time, who knows maybe i will take it up lateron, or maybe not.

Anyway thanks for your help.

Leo
 

Link to comment
Share on other sites

Well Couldn't resist to try something else.
Opened the Behaviors /Input events tab in developers mode and could find and test the LIGHTING_PANEL_1_Set, Dec and Inc events as shown in the picture attached and it works including the animation of the Overhead rotator.

But when i use one of those in my lua script i get the error Error sending Input Event 'LIGHTING_PANEL_1_Set' 

If i try to assighn it to a button, i only find LIGHTING_PANEL_1 without the possibillity to Set, dec or Inc in the pulldown menu.
if i use this LIGHTING_PANEL_1 event for a button it generates no error but doesn't accomplish anything.

Maybe i don't know enough about Input Events but could also not find a solution for this in the documentation.

EDIT: found the solution, if i use LIGHTING_PANEL_1 in my lua script with a parameter, it defaults to Set 
So it works now in my scrip for Set and i don't need Inc and Dec
For the test with assigning it to a button i did send always the same parameter so that explains why i didn't see any action.

thanks, Leo

Lighting_Panel_1 Input Events.jpg

Link to comment
Share on other sites

On 12/30/2023 at 9:36 PM, LeoSchoonbroodt said:

Finally found some time to test without the B: and it didn't work either altough the event is listed.
So decided to test another event in another plane, to make sure i understand how to do it, and to my supprise, that works.
Tried it with Button assignment and thereafter also in my lua script, both work.

So i went back to the original LIGHTING_PANEL_1_Inc event and tried this via Button assignment to no result.
EDIT: See now that i tried the found LIGHTING_PANEL_1 , so without the Set or Inc. See my post below.
Have given up on this, costs to much flying time, who knows maybe i will take it up lateron, or maybe not.

You should omit the 'B:', and use the input event name EXACTLY as listed by FSUIPC7.

On 12/31/2023 at 12:34 AM, LeoSchoonbroodt said:

But when i use one of those in my lua script i get the error Error sending Input Event 'LIGHTING_PANEL_1_Set' 

If i try to assighn it to a button, i only find LIGHTING_PANEL_1 without the possibillity to Set, dec or Inc in the pulldown menu.
if i use this LIGHTING_PANEL_1 event for a button it generates no error but doesn't accomplish anything.

Maybe i don't know enough about Input Events but could also not find a solution for this in the documentation.

EDIT: found the solution, if i use LIGHTING_PANEL_1 in my lua script with a parameter, it defaults to Set 
So it works now in my scrip for Set and i don't need Inc and Dec
For the test with assigning it to a button i did send always the same parameter so that explains why i didn't see any action.

Yes, you need to use the input event names as listed by FSUIPC, not in the behaviors window. Not all input events are currently exposed via simconnect API, but Asobo have indicated that more will be available in future releases. Use the Log->List Input Events menu to determine what input events are available, and use the names exactly as specified there.

John

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.