Jump to content
The simFlight Network Forums

Recommended Posts

Posted

How do I hook one of the InputEvents as displayed by the Log->List Input Events menu item ??

None of the event.XXXXX functions in the lua library would seem to apply or am I missing something (probably)

Plus I cant find any definition anywhere of "AUTOPILOT_FLC_Button" as displayed in that list

thanks

 

Posted
35 minutes ago, drave said:

How do I hook one of the InputEvents as displayed by the Log->List Input Events menu item ??

What do you mean by 'hook' in this context? You assign to input events as you would any other event type, but by checking 'Select for Input Event' (but not for axes due to calibaration issues)..

36 minutes ago, drave said:

None of the event.XXXXX functions in the lua library would seem to apply or am I missing something (probably)

Ah, no - there is no event handling function for Input Events. You can add the input event to an FSUIPC offset (via the ini file) and use the event.offset function. See the Advanced User guide on adding Input Events to offsets - basically works in the same way as adding lvars to offsets, but using a different ini section.

I will look into adding an event.InputEvent lua function in a fuuture release.

John

Posted
10 minutes ago, John Dowson said:

What do you mean by 'hook' in this context? You assign to input events as you would any other event type, but by checking 'Select for Input Event' (but not for axes due to calibaration issues)..

Ah, no - there is no event handling function for Input Events. You can add the input event to an FSUIPC offset (via the ini file) and use the event.offset function. See the Advanced User guide on adding Input Events to offsets - basically works in the same way as adding lvars to offsets, but using a different ini section.

I will look into adding an event.InputEvent lua function in a fuuture release.

John

 

Hook as in - Run some of my code when this event happens. 

I'll have to look into using the event.offset method 

thanks

dave

 

Posted

Just another quick question

What can the events shown by Log->List Input Events be used for ??

thanks

 

Posted

It shows the input events that can be used for assignments, to buttons/switches & key presses natively, or via lua for axes. The same as listing available lvars (via Add-Ons->WASM->List Lvars).

You can also log lnput event value changes by setting Log->Input Events. This is needed to determine the values (discrete or range) that the input event accepts and how they relate to the function (e.g. the value for each position in a switch).

 

  • 3 months later...
Posted

I tried to use the post above to assign a button on my Arduino hardware that is very usefull, toghether with FSUIPC 7. It almost worked...

I put the following lines on my LUA file:

    altcmd = 65590
    altoffset = 1

    ipc.control(altcmd,altoffset)  -- control to toggle strobe lights

and to FSUIPC.INI the lines:

     [InputEventOffsets.Default]
     0=AIRLINER_LIGHTS_EXT_STROBE=65590

The name comes out when I press the control fot strobe control on MSFS 2020

This was on Airbus A350 from iniBuilds.

I got the error below in FSUIPC log console

image.png.b4fa2f36386c22c7e37b64d72f5a8664.png

What did I do wrong ?

Thanks in advance

Posted

I am slightly confused by this. Is AIRLINER_LIGHTS_EXT_STROBE an Input Event? If so, you can just assign directly to that, or in lua you can use the ipc.execInputEvent function. You can it it to an offset if you like, and can then write to that offset to trigger the input event using one of the ipc.writeXX functioons. But you cannot add it to offset 65590 - that is outside the range of available offsets. Choose one in an offset area that is free for general use, such as 0xA000, e.g. to add as a byte value (for 1/0 or on/off values, or numbers in range 0 to 255 or -125 to +125) it would be:

[InputEventOffsets.Default]
0=AIRLINER_LIGHTS_EXT_STROBE=UB0xA000

You can then assign to Offset Byte Setbits or Togglebits, and in lua you would use ipc.writeUB.
But you only need to add it to an offset if you need to read the value for some reason.

14 hours ago, Gilson said:

I put the following lines on my LUA file:

    altcmd = 65590
    altoffset = 1

    ipc.control(altcmd,altoffset)  -- control to toggle strobe lights

This doesn't makes sense and gives that error you see, This sends the FS control with number 65590. There is no such control with this number hence the error. Do not confuse control numbers with offsets - they are completely different things.

Please also note that these forums are now closed. Please use the new support forums, available here: https://fsuipc.com/support/

John

Please sign in to comment

You will be able to leave a comment after signing in



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.