Menu

#2459 keyboard.xml: <binding><condition> gets through to aircraft bindings.

None
Accepted
nobody
None
Low
2024-10-22
2020-12-09
No

While cleaning up MiG-15 keybinds I found one that does not work because of <condition> in FGData's keyboard.xml, which is like:

 <key n="83">
  <name>S</name>
  <desc>Swap panels</desc>
  <binding>
   <condition>
     <not>
     <property>/sim/allow-toggle-cockpit</property>
     </not>
   </condition>
   <command>property-swap</command>
   <property>/sim/panel/path</property>
   <property>/sim/panel_2/path</property>
  </binding>
  <binding>
   <condition>
     <not>
     <property>/sim/allow-toggle-cockpit</property>
     </not>
   </condition>
   <command>panel-load</command>
  </binding>
 </key>

Aircraft-side binding is:

      <key n="83">
        <name>Shift-S</name>
        <desc>Earth/Air Starter ignition type</desc>
        <binding n="0">
          <command>property-toggle</command>
          <property>fdm/jsbsim/systems/leftpanel/ignition-type-input</property>
        </binding>
      </key>

and it does not work unless I --prop:/sim/allow-toggle-cockpit=false

Adding a <condition> that is true aircraft-side does not seem to help.

Discussion

  • Anonymous

    Anonymous - 2020-12-09
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -37,3 +37,5 @@
           &lt;/key&gt;
     ```
     and it does not work unless I `--prop:/sim/allow-toggle-cockpit=false`
    +
    +Adding a `&lt;condition&gt;` that is true aircraft-side does not seem to help.
    
     
  • James Turner

    James Turner - 2020-12-10

    Te generic 'S' binding is essntially obsolete, I would say (only relevant to old 2D panels).

    But I susepct the larger bug is that when replacing a key-bindig in an aircraft, we don't clear out other children. Essentially, the way we replace keybindings is not very clever, it could benefit froma. re-design.

     
  • Anonymous

    Anonymous - 2020-12-10

    But old 2D panels are still there?

    For now I could find a workaround for aircraft not using 2D panels:
    starting from <binding n="2"> instead of just <binding> or <binding n="0">.

     
  • James Turner

    James Turner - 2020-12-10

    Yes you could just use binding n=2 or n=99 since the other binding is basically inactive.

     
  • Gijs

    Gijs - 2024-10-22
    • status: New --> Accepted
     

Log in to post a comment.

MongoDB Logo MongoDB