• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Are multiple <On> sections allowed within <Keys>?

Messages
1,564
Country
thailand
FS9 Syntax question:

Are multiple <On> sections allowed within <Keys>?

Code:
<Keys>
  <On Key="Ascii">
    <Visible>(L:KBEnabled, bool) (L:EntryBox101, bool) &amp;&amp;</Visible>
      'EntryVar101' (>C:XMLVARS:SearchVarName, string) 
      (C:XMLVARS:NumberValue, number) (M:Key) chr scat (>C:XMLVARS:NumberValue, number)
  </On>
  <On Key="Ascii">
    <Visible>(L:KBEnabled, bool) (L:EntryBox102, bool) &amp;&amp;</Visible>
      'EntryVar102' (>C:XMLVARS:SearchVarName, string) 
      (C:XMLVARS:StringValue, number) (M:Key) chr scat (>C:XMLVARS:StringValue, number)
  </On>
  <On Key="Ascii">
    <Visible>(L:KBEnabled, bool) (L:EntryBox103, bool) &amp;&amp;</Visible>
      'EntryVar103' (>C:XMLVARS:SearchVarName, string) 
      (C:XMLVARS:NumberValue, number) (M:Key) chr scat (>C:XMLVARS:NumberValue, number)
  </On>
</Keys>

Whaddayathink?

Thanks in advance,

Bob
 
FS9 Syntax question:

Are multiple <On> sections allowed within <Keys>?

Whaddayathink?

Thanks in advance,

Bob
Yes, multiple <On> sections are allowed.

You can use something like:
Code:
<Keys> 
<On Key="K"> activate some gauge code </On>
<On Key="Z"> activate some gauge code </On> 
</Keys>
Or something like:
Code:
<Keys> 
<On Key="90">...</On> <!-- traps 'Z' --> 
<On Key="346">...</On> <!-- traps 'Shift-Z' -->  
<On Key="602">...</On> <!-- traps 'Control-Z' -->  
<On Key="858">...</On> <!-- traps 'Shift-Control-Z' --> 
</Keys>
And you can use also:
Code:
<Keys> 
<On Event="key event">activate some gauge code</On> 
<On Key="K"> activate some gauge code </On> 
</Keys>
So I believe your code should be alright.
 
Whaddayathink?

Thanks in advance,

Bob

As Joao stated, multiple <On> are allowed. However in this case repeating the same event would be a waste of resources, as you could perfectly manage everything in only one script:


Code:
<Macro Name="AddChar">
      (>C:XMLVARS:SearchVarName, string) 
      (C:XMLVARS:NumberValue, number) (M:Key) chr scat (>C:XMLVARS:NumberValue, number) 
</Macro>

 <On Key="Ascii">
    <Visible>(L:KBEnabled, bool)</Visible>
    (L:EntryBox101, bool) if{ 'EntryVar101' @AddChar }
    (L:EntryBox102, bool) if{ 'EntryVar102' @AddChar }
    (L:EntryBox103, bool) if{ 'EntryVar103' @AddChar }
</On>

Hope this helps:)

Tom
 
Back
Top