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 9: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: 156
Joined: Wed Mar 12, 2014 12:53 am
Callsign: PH-JAKE
Version: 2020.3.18
OS: Debian trixie

Re: Order of multiple bindings

Postby stuart » Thu May 14, 2020 9: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: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Order of multiple bindings  

Postby WoodSTokk » Thu May 14, 2020 12:50 pm

PH-JAKE wrote in Wed May 13, 2020 9: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: 1077
Joined: Tue Oct 17, 2017 3:30 pm
Location: Milky Way/Sol/Earth/Europe
Callsign: SX-W57
IRC name: WoodSTokk
Version: 2020.4.0
OS: Debian Bullseye

Re: Order of multiple bindings

Postby PH-JAKE » Thu May 14, 2020 1: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: 156
Joined: Wed Mar 12, 2014 12:53 am
Callsign: PH-JAKE
Version: 2020.3.18
OS: Debian trixie

Re: Order of multiple bindings

Postby stuart » Thu May 14, 2020 3: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: 1629
Joined: Wed Nov 29, 2006 10:56 am
Location: Edinburgh
Callsign: G-MWLX

Re: Order of multiple bindings

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

stuart wrote in Thu May 14, 2020 3: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)
Some YouTube videos
Johan G
Moderator
 
Posts: 6625
Joined: Fri Aug 06, 2010 6:33 pm
Location: Sweden
Callsign: SE-JG
IRC name: Johan_G
Version: 2020.3.4
OS: Windows 10, 64 bit


Return to Development

Who is online

Users browsing this forum: No registered users and 4 guests