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

Using left / right mouse clicks in the VC

Messages
47
Country
belgium
Hi guys,

Is there any way one can use left and right mouse clicks in the VC (for instance to move a button left or right) and attach separate events to these mouse clicks (Left=value -1; right=value+1)? So far we only get left mouse clicks to work...

Thx,
Björn
 
Hi
Yes you can apply any of the usable(fs supported) mouse functions to any switch ....But only at the code level if its a 2d xml code then anybody can alter it. If ts a C++ 2d or 3d modeled gauge/part then only the author/designer can change it.
Wozza
 
Of course! It's very similar to what you'd do in an XML "gauge" script...

Code:
      <MouseFlags>LeftSingle+RightSingle+Wheel</MouseFlags>
      <CallbackCode>

        (M:Event) 'RightSingle' scmp 0 ==
             if{ (L:AntiIceOff, enum) -- 0 max (>L:AntiIceOff, enum) }

        (M:Event) 'LeftSingle' scmp 0 ==
             if{ (L:AntiIceOff, enum) ++  2 min (>L:AntiIceOff, enum) }

        (M:Event) 'WheelUp' scmp 0 ==
             if{ (L:AntiIceOff, enum) -- 0 max (>L:AntiIceOff, enum) }

        (M:Event) 'WheelDown' scmp 0 ==
              if{ (L:AntiIceOff, enum) ++  2 min (>L:AntiIceOff, enum) }

        <!-- Insert any scripts you want excecuted regardless of button/wheel used below this comment -->
        (L:VC_Click,bool) ! (>L:VC_Click,bool)
        1 (>L:XMLClick,enum)

      </CallbackCode>

Note that if you wish the Wheel to also be used, you must provide a separate entry for Up and Down as shown above. Of course, you could also assign completely different commands for the Wheel as well!

For example, a HDG knob frequently may be turned to set the heading, but also could be "pushed" to synch the HDG bug to the a/c's current heading.

As a matter of fact, you could script up to fifteen separate actions within a single mouse rectangle, although I can't imagine any reason to do so!

LeftDown
LeftDouble
LeftRelease
LeftDrag

MiddleDown
MiddleDouble
MiddleRelease
MiddleDrag
WheelUp
WheelDown

RightDown
RightDouble
RightRelease
RightDrag

Leave

Also, another parameter that few know about may be included in the <MouseFlags> entry:

DOWNREPEAT // this works just like the Down_Repeat used in XML "gauge" scripts!

For a complete list of <MouseFlags> available for modeldef.xml scripting, see the Using Modeling Tools SDK document.
 
Last edited:
Back
Top