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

An XML question

Messages
2,178
Country
us-ohio
Will the following code set the LVar MOUSE_EVENT_ID based on the mouse button down or up?

Code:
    <MouseRect>
        <Cursor>Hand</Cursor>
        <MouseFlags>LeftSingle+LeftRelease</MouseFlags>
        <CallbackCode>
            (M:Event) 'LeftSingle' scmp 0 ==                                              
                if{ 0x184E5 (>L:MOUSE_EVENT_ID,enum) }
            (M:Event) 'LeftRelease' scmp 0 ==
                if{ 0x184E3 (>L:MOUSE_EVENT_ID,enum) }                                                  
        </CallbackCode>
    </MouseRect>
 
It won't if you release while your mouse is off the part though.
 
True. Unfortunately AFAIK Leave is not available in modeldef scripts.

Tom
 
It is actually. Just checked the SDK and it is in the available mouse flags.
 
Yes, Leave is available in gauge scripts, but I recall not being able to make it work in modeldef file.

Would be great that someone could do a quick test and report back.

Tom
 
This works for me just fine:
Code:
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle+RightSingle+Wheel+DownRepeat+MiddleSingle+MiddleRelease+MiddleDrag</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 ==
        (M:Event) 'WheelDown' scmp 0 == or
        if{ (L:0x110EB, enum) -- (>L:0x110EB, enum) 0x110EB (>L:EVENT,enum) 1 (>L:XMLSND2,bool) (L:0x110EB, enum) 0 &lt; if{ 50 (>L:0x110EB, enum) } }

        (M:Event) 'RightSingle' scmp 0 ==
        (M:Event) 'WheelUp' scmp 0 == or
        if{ (L:0x110EB, enum) ++ (>L:0x110EB, enum) 0x110EC (>L:EVENT,enum) 1 (>L:XMLSND2,bool) (L:0x110EB, enum) 50 &gt; if{ 0 (>L:0x110EB, enum) } }

        (M:Event) 'MiddleSingle' scmp 0 ==
        if{ 1 (>L:0x110ED, enum) 0x110ED (>L:EVENT,enum) 1 (>L:XMLSND5,bool) }
        (M:Event) 'MiddleRelease' scmp 0 ==
        (M:Event) 'MiddleDrag' scmp 0 == or
        if{ 0 (>L:0x110ED, enum) }
      </CallbackCode>
    </MouseRect>
NOTE: For convenience I use the hex number for the L:var instead of some alphabetic name.
 
Last edited:
May i ask you how you get the hex number??

I'm sure it's somewhere explained. But i can't found it.

EDi
 
Yes, Leave is available in gauge scripts, but I recall not being able to make it work in modeldef file.

Would be great that someone could do a quick test and report back.

Tom
I was looking in the modeldef section. Besides, (M:Event) should put out the 'Leave' string whether it is in a XML gauge or the modeldef.
 
May i ask you how you get the hex number??

I'm sure it's somewhere explained. But i can't found it.

EDi

He is using custom 3rd party hex events. They can be made to do whatever you like in a C++ gauge, and range in value from 0x11000 to 0x1FFFF.
 
I was looking in the modeldef section. Besides, (M:Event) should put out the 'Leave' string whether it is in a XML gauge or the modeldef.

It seems that doesn't work though. See post #7.

Also gauge and modeldef tokens are not the same. In gauges the Event flags are included in a string as a property of <Click> token, ie <Click Kind="LefSingle+Leave"/>. In modeldef they become a value of <MouseFlags> token. I guess something got lost in the difference...

Tom
 
Back
Top