Board index FlightGear Development

Order of multiple bindings  Topic is solved

FlightGear is opensource, so you can be the developer. In the need for help on anything? We are here to help you.
Forum rules
Core development is discussed on the official FlightGear-Devel development mailing list.

Bugs can be reported in the bug tracker.

Order of multiple bindings

Postby PH-JAKE » Wed May 13, 2020 8:42 pm

The several Wiki pages on bindings and keyboard bindings state that multiple bindings are possible, optionally conditional. However there's no mention of the sequencing of these bindings, e.g., two bindings for a single key. So my questions are:

  1. Is there a guaranteed order in a set of bindings.
  2. If there's a guaranteed order, how is this determined? By the order in the XML file, through a property, or otherwise?
  3. Is there a sequence point between multiple bindings? Can I assume the operations of the previous bindings have taken effect when the next binding is executed, so that properties have their new values and conditionals can be evaluated with the new state?

Or is it simply safer to assume these are independent and should be implemented as such?
PH-JAKE
 
Posts: 138
Joined: Tue Mar 11, 2014 11:53 pm
Callsign: PH-JAKE
Version: 2020.1.3
OS: Debian bullseye

Re: Order of multiple bindings

Postby stuart » Thu May 14, 2020 8:37 am

I'm 99% sure that they will be executed sequentially in whatever order they are in the XML file, so properties will have any new values. Should be easy enough to test :)

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1559
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Order of multiple bindings  

Postby WoodSTokk » Thu May 14, 2020 11:50 am

PH-JAKE wrote in Wed May 13, 2020 8:42 pm:The several Wiki pages on bindings and keyboard bindings state that multiple bindings are possible, optionally conditional. However there's no mention of the sequencing of these bindings, e.g., two bindings for a single key. So my questions are:

  1. Is there a guaranteed order in a set of bindings.
  2. If there's a guaranteed order, how is this determined? By the order in the XML file, through a property, or otherwise?
  3. Is there a sequence point between multiple bindings? Can I assume the operations of the previous bindings have taken effect when the next binding is executed, so that properties have their new values and conditionals can be evaluated with the new state?

Or is it simply safer to assume these are independent and should be implemented as such?


Its exactly as you describe it.
I have some property changes in XML files inside one pick-trigger where later property changes relay on the earlier property change (with conditions) and all works normal.
WoodSTokk
 
Posts: 547
Joined: Tue Oct 17, 2017 2:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: OE-WST
IRC name: WoodSTokk
Version: 2020.3.0
OS: Debian Buster

Re: Order of multiple bindings

Postby PH-JAKE » Thu May 14, 2020 12:58 pm

Okay thanks Stuart, WoodSTokk, for confirming this.

As I see it now, it is observed and used behavior, just not documented. Hopefully it's not going to be changed then.
For now it's not essential for my implementation, so I can stay away from it, leaving it as a potential code reduction.
PH-JAKE
 
Posts: 138
Joined: Tue Mar 11, 2014 11:53 pm
Callsign: PH-JAKE
Version: 2020.1.3
OS: Debian bullseye

Re: Order of multiple bindings

Postby stuart » Thu May 14, 2020 2:44 pm

Yes, a lot of this isn't documented.

This behaviour isn't something that's going to be changed, so please feel free to update the wiki page so that it becomes documented :).

-Stuart
G-MWLX
User avatar
stuart
Moderator
 
Posts: 1559
Joined: Wed Nov 29, 2006 9:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Order of multiple bindings

Postby Johan G » Tue Jun 30, 2020 12:29 pm

stuart wrote in Thu May 14, 2020 2:44 pm:This behaviour isn't something that's going to be changed, so please feel free to update the wiki page so that it becomes documented :) .

For now I have added a link to http://wiki.flightgear.org/Bindings#Related_content.
Low-level flying — It's all fun and games till someone looses an engine. (Paraphrased from a YouTube video)
Improving the Dassault Mirage F1 (Wiki, Forum, GitLab. Work in slow progress)
Johan G
Moderator
 
Posts: 5791
Joined: Fri Aug 06, 2010 5:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 3.0.0
OS: Windows 7, 32 bit


Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest