• 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.

Combining Key Events

Messages
27
Country
unitedkingdom
Hallo,

I have the following gauge switch to control the doors on an aircraft.
It uses two buttons to open and close two separate doors.

<Gauge Name="Doorcontrol" Version="0.1">
<Image Name="Beech_58.bmp" Luminous="No" ImageSizes="200,100"/>
<!-- DISPLAY =============================================== -->
<Element>
<Image Name="switch_A_on.bmp" ImageSizes="38,60"/>
<Position X="28" Y="35"/>
</Element>
<Element>
<Image Name="switch_A_on.bmp" ImageSizes="38,60"/>
<Position X="114" Y="35"/>
</Element>

<!-- Main Exit - Display -->

<Element>
<Visible>(A:CANOPY OPEN,enum) 1 ==</Visible>
<Image Name="switch_A_off.bmp" ImageSizes="38,60"/>
<Position X="28" Y="35"/>
</Element>


<!-- Engine Canopy - Display -->

<Element>
<Visible>(A:EXIT OPEN:1, enum) 1 ==</Visible>
<Image Name="switch_A_off.bmp" ImageSizes="38,60"/>
<Position X="114" Y="35"/>
</Element>


<!-- MOUSE BUTTONS ==================================================== -->
<Mouse>
<Help_none/>

<!-- Main Exit - Button -->
<Area Left="28" Top="35" Width="38" Height="60">
<Click Event="TOGGLE_AIRCRAFT_EXIT"/>
<Cursor Type="Hand"/>
</Area>

<!-- Engine Canopy - Button -->
<Area Left="114" Top="35" Width="38" Height="60">
<Click>(>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_2)</Click>
<Cursor Type="Hand"/>
</Area>

</Mouse>
</Gauge>


I would like to combine the two Key Events into one mouse click.
That is, I wish to open both doors simultaneously with one button.
How can this be done? I would be grateful for any help.

Terry
 
Last edited:
Easy! :D
Code:
<Click>
     (>K:TOGGLE_AIRCRAFT_EXIT)
     (>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_2)
</Click>
 
Hi Bill,
Thanks for your invaluable help.
I am new to gauge programming so everything is not easy for me.
I have tried your code (see below) but unfortunately, it doesn't work.
The FSX key to open the second door is Shift + E + 2.
Terry

<Gauge Name="PC12 Doors Switch" Version="1.0">
<Image Name="PC12_Off.bmp" ImageSizes="68,66,68,66"/>
<Element>
<Visible>(A:CANOPY OPEN,bool)</Visible>
<Image Name="PC12_On.bmp" ImageSizes="68,66,68,66"/>
</Element>


<Mouse>
<Tooltip>"MAIN EXIT"</Tooltip>
<Cursor Type="Hand"/>
<Click>
(>K:TOGGLE_AIRCRAFT_EXIT)
(>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_2)
</Click>
</Mouse>
</Gauge>
 
Well, that's what the second line is for...

You will likely need to introduce some delay before the second event fires though...

Perhaps sending a "dummy command" several times will work:

Code:
<Click>
     (>K:TOGGLE_AIRCRAFT_EXIT)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_2)
</Click>

And please, when posting "code" use the # button to wrap your "code" in
Code:
 tags. It makes it [U]so[/U] much easier to read! :)
 
Sorry about the code button.
I tried your suggestion of inserting a delay. Now the button click opens the second exit, but not the main exit. Also, the bitmap does not change from closed to open (i.e. off to on)

Terry
 
Okay, then try being explicit about door #1:
Code:
<Click>
     (>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_1)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:KEY_ROTOR_BRAKE)
     (>K:TOGGLE_AIRCRAFT_EXIT) (>K:SELECT_2)
</Click>
 
Hi Bill,
Still does not work. Only Door 2 opens.
If I place Select_2 before Select_1, then Door 1 opens.
Apparently this will not work with these Events.
Therefore, I have decided to abandon the idea and revert back to the two separate buttons, i.e. one button for each individual door.
Thanks for your help.
Terry
 
No problem. I'm sorry it won't work out. I never actually tried this myself, but was basing my suggestions on another event that requires SELECT_n commands sent in sequence.
 
Back
Top