Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

I am currently developing an aircraft where I need to have a custom throttle behaviour based on throttle input.

Hence I created an InputEvent in the XML where I intercept all throttle bindings like the following:

		<Set>
                    <Code>
                        p0 (&gt;L:THROTTLE_POS_#ID#, percent)
                    </Code>
                    <Parameters>
                        <Param Type="Int" RPN="True">p0</Param>
                    </Parameters>
                    <Bindings>
                        <Binding EventID="AXIS_THROTTLE#ID#_SET">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="AXIS_THROTTLE_SET">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="THROTTLE#ID#_SET">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="THROTTLE_SET">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="THROTTLE#ID#_AXIS_SET_EX1">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="THROTTLE_AXIS_SET_EX1">
                            <Param Type="Int" RPN="True">#THROTTLE_AXIS_BINDING_CODE#</Param>
                        </Binding>
                        <Binding EventID="THROTTLE#ID#_FULL">
                            <Param Type="Int" RPN="True">100</Param>
                        </Binding>
                        <Binding EventID="THROTTLE_FULL">
                            <Param Type="Int" RPN="True">100</Param>
                        </Binding>
                        <Binding EventID="THROTTLE#ID#_CUT">
                            <Param Type="Int" RPN="True">0</Param>
                        </Binding>
                        <Binding EventID="THROTTLE_CUT">
                            <Param Type="Int" RPN="True">0</Param>
                        </Binding>
                    </Bindings>
                </Set>

It is working perfectly fine when assigning my throttle axis inside MFS controls options.

However, if I use FSUIPC to bind my throttle axis (using "Send to FS as normal axis" with "Axis Throttle 1 Set"), this InputEvent is never called.

I can see in FSUIPC console that the InputEvent is not received.

Do I need additional code in my XML is order to solve the problem?

 

Thanks!

Posted
6 hours ago, NookyBookyIV said:

It is working perfectly fine when assigning my throttle axis inside MFS controls options.

However, if I use FSUIPC to bind my throttle axis (using "Send to FS as normal axis" with "Axis Throttle 1 Set"), this InputEvent is never called.

I can see in FSUIPC console that the InputEvent is not received.

Do I need additional code in my XML is order to solve the problem?

Controls that go from external apps via SimConnect do not go through the same route as internal controls. This has already  been raised with Asobo - see https://devsupport.flightsimulator.com/t/xml-key-event-bindings-do-not-intercept-key-events-via-simconnect/8320.

I am not an aircraft developer/gauge programmer, so cannot really assist you with this xml code.

Can you see the Input Event in FSUIPC (Log->List Input Events)? If so, you can use this directly. However, you can only assign to Input Events for buttons, keys and when entering/leaving axis ranges. To assign an axis to an Input Event in FSUIPC, you have to assign the axis to write to an FSUIPC offset, have a lua script that monitors the offset (using event.offset), calibrates the axis value to the Input Event range, and then send the Input Event using ipc.execInputEvent.

It is also not clear to me how Asobo determine what Input Events are available via the SimConnect Input Event interface/functions. This would also be a question for Asobo.

Sorry I can't be of more assistance - as I say, I am not a gauge programmer and you would get more help with this on the Asobo forums.

John

 

 

Posted

Thanks John, it seems to be the logical explanation.

I do not see my InputEvent in FSUIPC console, it is never called.

I would like to be able to have it working simply by assigning the throttle to an axis, using an offet + LUA script is not an option for most of the users.

I will follow the bug logged on Asobo side, thanks for your help.

 

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.