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

Multiple <EventID> code?

Messages
64
Country
unitedkingdom
Hi,
Is there a way of using different <EventID> calls from the modeldef? Something that would work a little like this:

<MouseRect>
<MouseFlags>LeftSingle+RightSingle</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 == <EventID>0x11092</EventID>
(M:Event) 'RightSingle' scmp 0 == <EventID>0x11093</EventID>
</CallbackCode>
</MouseRect>

The code is for calling different functions in a C++ gauge.

Thanks all!
 
Actually you can't use this:

Code:
(M:Event) 'LeftSingle' scmp 0 == <EventID>0x11092</EventID> 
(M:Event) 'RightSingle' scmp 0 == <EventID>0x11093</EventID>

Instead, analog functionality could be obtained by sending data through an unused event. For example, helos ROTOR BRAKE event will work in airplanes, something like:

Code:
(M:Event) 'LeftSingle' scmp 0 == if{ 1001 (>K:ROTOR BRAKE,position) } 
(M:Event) 'RightSingle' scmp 0 == if{ 1002 (>K:ROTOR BRAKE,position) }

then capturing the event in the C++ gauge.

Tom
 
If you want to use hex events then pass the hex value to an L var eg 0x11000 (>L:EVENT, enum). Monitor that L var in your C++ gauge and if it is != 0 pass it through trigger_key_event and then reset the L var to 0.
 
Expanding a bit on the previous suggestions, here is an example of passing two separate hex-number custom EventIDs. Note also that I'm defining the Mouse Wheel at the same time so that unexpected things don't happen should the user choose to use the Wheel instead of Left/Right click!
Code:
    <MouseRect>
      <Cursor>Hand</Cursor>
      <MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown</MouseFlags>
      <CallbackCode>
        (M:Event) 'LeftSingle' scmp 0 == 
        (M:Event) 'WheelDown' scmp 0 == or
              if{ 0x11032 (>L:EVENT,enum) }

        (M:Event) 'RightSingle' scmp 0 == 
        (M:Event) 'WheelUp' scmp 0 == or
              if{ 0x11033 (>L:EVENT,enum) }
      </CallbackCode>
    </MouseRect>
Of course, you could also define the WheelUp and WheelDown events to send two different EventIDs as well. Don't forget MiddleSingle should you have need of a "press to set some default value" type of control such as "synch heading bug", or "set standard baro pressure":
Code:
   (M:Event) 'MiddleSingle' scmp 0 == if{ 16211.2 (&gt;K:KOHLSMAN_SET) }
 
Last edited:
Back
Top