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

[SOLVED] Mouse Area Not Working

Messages
260
Country
us-kentucky
Hello,

As the title suggests, I cannot get both of these mouse areas working together. This mouse section is for two buttons directly side by side. The left button works just fine, but the right button (lowest in the code) does not have a clickable area.

What am I doing wrong? I have poured over the help documents and cannot figure this out.

XML:
<Mouse>
    <Area Left="0" Width="22" Height="24">
        <Tooltip>EPRL Derate 1</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 1, bool) ! (>L:EPRL Derate 1, bool)</Click>
    </Area>
    <Area Left="26" Width="22" Height="24">
        <Tooltip>EPRL Derate 2</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 2, bool) ! (>L:EPRL Derate 2, bool)</Click>
    </Area>
</Mouse>
 
Have you try to "comment" out the left section and see what happens in sake of troubleshooting?
I dont know but mines have a "Top" as well which defines where the area begins maybe yours are overlapping because of that??

<Area Left="375" Top="110" Width="50" Height="50">
 
Have you try to "comment" out the left section and see what happens in sake of troubleshooting?
I dont know but mines have a "Top" as well which defines where the area begins maybe yours are overlapping because of that??

<Area Left="375" Top="110" Width="50" Height="50">

Taking out the left button section does nothing. The right button still does not work.

Same thing with adding a Top= instruction.
 
Hello,
Example: For an area 40 x 30 it should look like this:

Horizontal:
Area Left="0" Right="20" Top="0" Bottom="30">
...
Area Left="20" Right="40" Top="0" Bottom="30">
...
Vertical:
Area Left="0" Right="40" Top="0" Bottom="15">
...
Area Left="0" Right="40" Top="15" Bottom="30">
...
 
Hello Chris

If your are trying to create what is called "nested areas", those are handled with hierarchy in mind (parent - child):
A mouse parent area is defined first ; then you ascribe the child areas inside the rectangle defined by the parent area.

This method might be a little be tricky if you are not sure of what are you "seeing" in your gauge design.
See how it is construced if you want them to work in this way. I have a working sample here (see the image sequence):

In this example, the parent area is defined first; the image has the proper dimensions if you want to follow the example:
SK407_ADF.jpg


HTML:
      <Mouse>
      <!-- ADF Card Knob -->
      <!-- When an ADF signal is received, the pilot rotates the card so that the present heading is at the top of the scale.
            This results in the pointer indicating the magnetic bearing to the ADF transmitter.
            This is more intuitive and consistent with other navigational practices. -->
        
      <!-- ADF Card Heading Change Knob -->
          <Area Left="36" Top="594" Width="131" Height="131">
          <ToolTip>HDG: %((A:ADF CARD,degrees))%!03.0f!°</ToolTip>
      
              <!-- HDG DEC-->
              <Area Right="60">
                  <Cursor Type="DownArrow"/>
                  <Click Repeat="Yes">
                      <!-- This code is used instead (>K:ADF_CARD_DEC) to prevent the 10 degree jump due event overflowing induced by the autopilot-->
                      (A:ADF CARD,degrees) -- dnor (>K:ADF_CARD_SET)
                      1 (>L:Bell_407_Rotary_Click, number)
                  </Click>
              </Area>
          
              <!-- HDG INC-->
              <Area Left="66">
                  <Cursor Type="UpArrow"/>
                  <Click Repeat="Yes">
                      <!-- This code is used instead (>K:ADF_CARD_INC) to prevent the 10 degree jump due event overflowing induced by the autopilot-->
                      (A:ADF CARD,degrees) ++ dnor (>K:ADF_CARD_SET)
                      1 (>L:Bell_407_Rotary_Click, number)
                  </Click>
              </Area>
          </Area>
      </Mouse>

Look what the code actually does with the parent and child areas:
child areas.jpg


What the child areas are doing is clipping the parent area to have two separate "clickable" subareas inside the parent area... :duck:

On the other hand, if your intention is setup separate mouse areas (scattered around your main gauge), then pay attention to Adino and Tapen replies.
Take in mind, that using nested areas could have the same result of two separate mouse areas; it's just a matter of what you need or want to do.

I hope this make sense.
Sergio.
 
Last edited:
Chris, I tested your code in a TestGauge on my aircraft, using a background of 48x24 and your code as given here. Both (L:EPRL Derate 1, bool) and (L:EPRL Derate 2, bool) flip perfectly from 0 to 1 and back to 0.

Whatever other gauge you are using (L:EPRL Derate 2, bool) in must be at fault.

Code:
<Gauge Name="TestGauge" Version="1.0">
  <Image Name="TestGauge BG.bmp"/>

    <Element>
          <Position X="1" Y="8"/>
          <Text X="20" Y="10" Length="2" Font="Arial" Color="White" BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center" Multiline="No" Fixed="No">
                    <String>%((L:EPRL Derate 1, bool))%!2d!</String>
          </Text>
    </Element>

    <Element>
          <Position X="28" Y="8"/>
          <Text X="20" Y="10" Length="2" Font="Arial" Color="White" BackgroundColor="Black" Adjust="Right" VerticalAdjust="Center" Multiline="No" Fixed="No">
                    <String>%((L:EPRL Derate 2, bool))%!2d!</String>
          </Text>
    </Element>


<Mouse>
    <Area Left="0" Width="22" Height="24">
        <Tooltip>EPRL Derate 1</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 1, bool) ! (>L:EPRL Derate 1, bool)</Click>
    </Area>
    <Area Left="26" Width="22" Height="24">
        <Tooltip>EPRL Derate 2</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 2, bool) ! (>L:EPRL Derate 2, bool)</Click>
    </Area>
</Mouse>

</Gauge>
 
Last edited:
Hm. Interesting. I'll have to check on this one when I get back home in a couple days. Very much appreciate the input!
 
Chris, I tested your code in a TestGauge on my aircraft, using a background of 48x24 and your code as given here. Both (L:EPRL Derate 1, bool) and (L:EPRL Derate 2, bool) flip perfectly from 0 to 1 and back to 0.

Whatever other gauge you are using (L:EPRL Derate 2, bool) in must be at fault.

Hello,

I am finally back home to test this again. I have attempted to create both a parent/nest mouse area and an unnested series of mouse areas. Nothing is working still. I have no other mentions of L:EPRL Derate 2 anywhere else right now, and even if I did I would still expect that at least the clickable area is showing but it isn't.

This is my attempt at a nested mouse area, and shows the full gauge. When one button is selected, the other is suppose to automatically un-select. I am still not getting any clickable area for the second right-hand button though.

XML:
<Gauge Name="747 TAT/EPRL Indicator" Version="1.0">
<Element>
    <Position X="0" Y="0"/>
    <Visible>(L:EPRL Derate 1, bool) 1 == </Visible>
    <Image Name="Derate1.bmp"/>
</Element>
<Element>
    <Position X="26" Y="0"/>
    <Visible>(L:EPRL Derate 2, bool) 1 == </Visible>
    <Image Name="Derate2.bmp"/>
</Element>
<Element>
    <Select>
        <Value>
        (L:EPRL Derate 2, bool) 1 ==
        if{ 0 (>L:EPRL Derate 1, bool) }
        els{ 0 }
        (L:EPRL Derate 1, bool) 1 ==
        if{ 0 (>L:EPRL Derate 2, bool) }
        els{ 0 }
        </Value>
    </Select>
</Element>
<Mouse>
    <Area Left="0" Width="44" Height="24">
    <Area Left="0">
        <Tooltip>EPRL Derate 1</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 1, bool) ! (>L:EPRL Derate 1, bool)</Click>
    </Area>
    <Area Left="26">
        <Tooltip>EPRL Derate 2</Tooltip>
        <Cursor Type="Hand"/>
        <Click>(L:EPRL Derate 2, bool) ! (>L:EPRL Derate 2, bool)</Click>
    </Area>
    </Area>
</Mouse>
</Gauge>
 
Chris, I think that is because (L:EPRL Derate 2, bool) is not set to 1 to display Derate2.bmp.

Either Derate1.bmp or Derate2.bmp will show depending on which one's bool is set to 1.

It seems Derate1.bmp gets first choice.

I think you would have to have an invisible background 44x24 bmp in place to cater for both clickable areas.

Walter
 
Chris, I think that is because (L:EPRL Derate 2, bool) is not set to 1 to display Derate2.bmp.

Either Derate1.bmp or Derate2.bmp will show depending on which one's bool is set to 1.

It seems Derate1.bmp gets first choice.

I think you would have to have an invisible background 44x24 bmp in place to cater for both clickable areas.

Walter

Ah, I see! I did not realize I had to have a background bitmap that contains the active mouse area for a mouse area to work. Thank you! I now have it working.
 
Hello Chris

If I may:
  1. In your nested area you are using two "left" child areas; at least use one "right" area.
  2. Also, the parent area is missing something...
  3. As Walter said, need to verify your conditions.
  4. Perhaps, you need a background image.
Maybe something like this (take care of the "Element">"Select">"Value", seems wrong to me):
HTML:
<Gauge Name="747 TAT/EPRL Indicator" Version="1.0">
    <Image Name="IMAGE_AS_BACKGROUND.bmp"/>

    <Element>
        <Position X="0" Y="0"/>
        <Visible>(L:EPRL Derate 1, bool) 1 == </Visible>
        <Image Name="Derate1.bmp"/>
    </Element>

    <Element>
        <Position X="26" Y="0"/>
        <Visible>(L:EPRL Derate 2, bool) 1 == </Visible>
        <Image Name="Derate2.bmp"/>
    </Element>

    <Element>
        <Select>
            <Value>
            (L:EPRL Derate 2, bool) 1 ==
                 if{ 0 (>L:EPRL Derate 1, bool) }
                els{ 0 }
            (L:EPRL Derate 1, bool) 1 ==
                 if{ 0 (>L:EPRL Derate 2, bool) }
                els{ 0 }
            </Value>
        </Select>
    </Element>

    <Mouse>
        <!-- Maybe your "Top" value is zero. It's an educated guess -->
        <Area Left="0" Top="0" "Width="44" Height="24">
            <Area Left="0">
                <Tooltip>EPRL Derate 1</Tooltip>
                <Cursor Type="Hand"/>
                <Click>(L:EPRL Derate 1, bool) ! (>L:EPRL Derate 1, bool)</Click>
            </Area>
      
            <Area Right="26">
                <Tooltip>EPRL Derate 2</Tooltip>
                <Cursor Type="Hand"/>
                <Click>(L:EPRL Derate 2, bool) ! (>L:EPRL Derate 2, bool)</Click>
            </Area>
        </Area>
</Gauge>

Sergio.
 
Last edited:
Back
Top