This are the (new) Support Forums for FSUIPC and related products.

These forums replace the old support forums which have been running for 20+ years. The old forums contain a wealth of information on all FSUIPC products, and are still available (until the end of the year) for read-only here.

At the moment these new forums are quite empty – I will be updating the FAQ section and copying across the User Contributions from the old forums in the next few months.

Please note that you will need to Register and Login to post for support, and also to download attachments. You can view these forums without registering.

Support is also available via Discord. Please use the following invite link to join the FSUIPC Discord server:
https://discord.gg/zjwUTrxmmE

How to program joys…
 
Notifications
Clear all

How to program joystick buttons and keys to control PMDG aircraft using custom controls

(@fsuipc-support)
Posts: 173
Moderator
Topic starter
 

Please note that there are two methods to use PMDG custom controls. either directly or via using the Rotor Brake control. The difference between these methods is that the Rotor Brake control only accepts mouse operations as a parameter, whereas when using the custom controls directly the parameter is the new value to be used. This FAQ entry explains how to use custom controls directly  – please see the other FAQ entry on using custom controls via the Rotor Brake method..

If using FSUIPC7 (for MSFS), then many of the existing Rotor Brake controls are available via existing (MobiFlight) Presets

[N.B. This FAQ entry was provided by Paul Henty in the old FSUIPC support forums]

Background

PMDG Aircraft for FSX and P3D do not typically use the normal controls provided by the flight sim. This means that many of the aircraft’s switches cannot be assigned to buttons and keys using the list of controls in the FSUIPC dropdown boxes. Assigning a standard control in FSUIPC will likely do nothing in the PMDG aircraft when the button or key is pressed.

 

Solution

Instead of using the standard list of controls shown in the FSUIPC dropdown box, users must use a different set of controls provided by PMDG for the specific aircraft. These are known as custom controls (or custom events).

The custom controls vary for each aircraft and are listed in the SDK that is installed alongside the aircraft.

This guide will show you, step-by-step:

  1. How to find the SDK files
  2. How to calculate the custom control numbers
  3. How to work out the parameter value
  4. How to assign the control to buttons/keys in FSUIPC

The specific examples shown will be taken from the PMDG 737NGX, but the same method works for any PMDG aircraft with an SDK and custom controls (e.g. 777, 747).

 

1. Locating the SDK

  • From your main Flight Sim install folder, or your MSFS Community folder, and open the PMDG aircraft folder
  • Then select the folder belonging to the aircraft you want to use. e.g. PMDG 737 NG3 or pmdg-aircraft-737
  • Then select the SDK folder or Documentation\SDK folder for MSFS2020
  • Locate the file with the .h extension. For the 737 it’s called PMDG_NG3_SDK.h (or maybe PMDG_NGX_SDK.h, depending on the sim and variant you are using)
  • You can open this file with Notepad or your favourite text editor.

As an example, the document you need for the 737 in MSFS2020 will be:

[Community]\pmdg-aircraft-737\Documentation\SDK\PMDG_NG3_SDK.h

 

2. Calculating the control numbers

2.1. Find THIRD_PARTY_EVENT_ID_MIN

The first thing to find is the definition of THIRD_PARTY_EVENT_ID_MIN. Search for the following text:

#define THIRD_PARTY_EVENT_ID_MIN

You will find a line like this (from the 737 file):

#define THIRD_PARTY_EVENT_ID_MIN                0x00011000        // equals to 69632

Note the decimal value at the end. In the case above it’s 69632. You will need this value to calculate the control number in the next step.

2.2. Find the control you want to use.

Search for the control by name, or look through the listed controls to find the one you want. They are helpfully grouped together by panel.

The controls are listed under a comment:

// Control Events

You can search for this to find where the list of control numbers starts.

As an example we’ll use the Autopilot CMD A swtich on the MCP. This is the relevant line in the 737 SDK:

#define    EVT_MCP_CMD_A_SWITCH                    (THIRD_PARTY_EVENT_ID_MIN + 402)

To calculate the control number for this switch we just add 402 to the value of THIRD_PARTY_EVENT_ID_MIN we found earlier.

69632 + 402 = 70034

We have now calculated the control number. We will use this in step 4 to program the button/key.

 

3. Finding the parameter value

PMDG controls need a parameter value. These can one of type types:

3.1. Mouse Click Codes (Shown in the example)

You can use these to simulate a mouse click on the particular switch.

Mainly it will be the left mouse button, but other clicks types are available (e.g. Right button, left double click etc).

To find the codes for each type of click, search for

MOUSE_FLAG

You’ll find a block of #define statements for each type of mouse click. Here are a couple of examples from the 737 sdk:

#define MOUSE_FLAG_RIGHTSINGLE   0x80000000
#define MOUSE_FLAG_LEFTSINGLE    0x20000000

Find the click that you want to simulate and get the code. For example, we’ll have our key assignment simulate the left mouse button clicking on the CMD A autopilot button. So we’ll need 0x20000000 as the parameter value for the control.

3.2. Direct Values (Not shown in the example)

Alternatively, some controls can accept a direct value to set the switch to a specific position.

To find the direct values you need to look at the top part of the .h file to find the switch definition. These are named differently than the events so you need to search.

Taking the battery selector switch as an example, we find the control:

#define    EVT_OH_ELEC_BATTERY_SWITCH                        (THIRD_PARTY_EVENT_ID_MIN + 1)

For the parameter value we can find the same switch in the top part of the .h file:

unsigned char    ELEC_BatSelector;                    // 0: OFF  1: BAT  2: ON

This tells us that in addition to mouse clicks, we can also send direct values. In this case: 0 for the OFF position, 1 for the BAT position and 2 for the ON position.

It’s possible to make a key or button set the Battery Selector directly to the ON position by setting the parameter value to 2 instead of a mouse click code.

Simple ON/OFF switches will not have values listed (and will be declared as ‘bool’). For these types of switches you can just pass the value 0 for OFF and 1 for ON. 

 

4. Assigning the control to a button or key in FSUIPC

Select the [buttons + swtiches] or [key presses] tab in FSUIPC and select the button or key to program.

From the “control sent…” dropdown select <custom control> (it’s near the top of the list)

A popup window appears asking for the control number. Type in the control number you calculated in step 2. For our ‘autopilot CMD A’ example, we enter 70034 and click OK.

The controls dropdown box will now show the control number in angled brackets.

In the “parameter” box (below the controls dropdown), enter the parameter value from step 3.

This can be a mouse click code or a direct value.

Mouse Click Codes:

Do not include the first 0 from the number listed in the PMDG SDK. Start with the x. With our example, we would enter x20000000 for the left-button single-click.

Note that this code is in hexadecimal. FSUIPC will convert it to the equivalent decimal value. This is nothing to worry about. It’s the same number. Entering the value in Hex is more convenient.

Direct Values:

Just enter the value as a number. Do not add the x at the start like mouse codes.

 

If you’re programming a key press, remember to press the [confirm] button.

Here is our example control assigned to a button in FSUIPC:

image.png.35a15610e06ff4a05d7fbe3b944a55e3.png

Your button or key press should now operate the switch in your PMDG aircraft.


 
Posted : October 27, 2025 12:50 pm
(@skythelimit)
Posts: 19
Registered
 

Very good guide.  How do I do this (either using custom controls or the Rotor Brake method) if my card does not show as a joystick and therefore I cannot use the Button assignment in FSUIPC?

I have the InterfaceIT card and I have to assign specific fsuipc offsets within the InterfaceIT program.  For example, here is what I have for the TAT test button:-

Sending an FSUIPC offset when the button is pressed:-

Here are the various options under “Operation” in the image above, besides “Set bit”:-

and here are the various “input action” options other than update FSUIPC, just for info, I doubt the non-fsuipc options are relevant here:- 

I’m thinking maybe I would set the offset for Rotor Brake (which is that?) and then the “value” would be as discussed in the “Assignment using Rotor Brake” FAQ.  I assume the “direct method” wouldn’t be an option here. 


 
Posted : December 22, 2025 9:43 pm
(@fsuipc-support)
Posts: 173
Moderator
Topic starter
 

You can use offset area starting at 0x3110 to send any control (custom or rotor brake) to the FS, so use that.

Other offsets that may be useful are 0x0D70 (for macro and lua requests) and 0x7C50 (for lvars, hvars, presets and calculator code – FSUIPC7 only).

Please see the provided Offset Status document for details.

Note that I am now on holiday – please see the News section for details.

John 


 
Posted : December 23, 2025 8:56 am
(@skythelimit)
Posts: 19
Registered
 

Thx John

You can use offset area starting at 0x3110 to send any control (custom or rotor brake) to the FS

Will that work the other way too, from FS?  For example, if I wanted my speedbrake motor to action if it was armed, can I get the output from the following event via 0x3110?

#define EVT_CONTROL_STAND_SPEED_BRAKE_LEVER_ARM (THIRD_PARTY_EVENT_ID_MIN + 6792)

Will the FSUIPC offsets for “on the ground” (0x0366) and “speed” (0x02BC) still be registering values, even though this is a PMDG aircraft? (I can then have a script to action the speedbrake if the above Event is true + x0366 is true and x02BC is above a certain speed

Happy New Year!

Charles

 


 
Posted : December 29, 2025 2:48 pm
(@fsuipc)
Posts: 113
Admin
 

Posted by: @skythelimit

Will that work the other way too, from FS?  For example, if I wanted my speedbrake motor to action if it was armed, can I get the output from the following event via 0x3110?

That is an event, i.e. a custom control. There is no ‘output’.

Posted by: @skythelimit

Will the FSUIPC offsets for “on the ground” (0x0366) and “speed” (0x02BC) still be registering values, even though this is a PMDG aircraft? (I can then have a script to action the speedbrake if the above Event is true + x0366 is true and x02BC is above a certain speed

Maybe (I suspect On ground should be ok), but certainly not for all offsets…but always look at the PMDG-specific offsets first (they should take priority). There are two documents in your FSUIPC7 documents folder, one for specific offsets for the PMDG 737, and another for the PMDG 777. You have to enable these offsets, as instructed in the documentation.
Also, if using PMDG aircraft, you should update to the latest beta (7.5.6b) – see the News section for details and the download link.

John


This post was modified 2 weeks ago by FSUIPC
 
Posted : December 29, 2025 4:15 pm
(@skythelimit)
Posts: 19
Registered
 

I have enabled broadcast, updated to 7.5.6b and just tried the below sioc script to set the flaps, but there is no movement of the PMDG flap lever.  The PMDG events have a separate Flaps Lever, I’m unsure what this is and whether I should be including it, here are the events:

#define EVT_CONTROL_STAND_FLAPS_LEVER					(THIRD_PARTY_EVENT_ID_MIN + 714)
#define EVT_CONTROL_STAND_FLAPS_LEVER_0					(THIRD_PARTY_EVENT_ID_MIN + 7141)
#define EVT_CONTROL_STAND_FLAPS_LEVER_1					(THIRD_PARTY_EVENT_ID_MIN + 7142)
#define EVT_CONTROL_STAND_FLAPS_LEVER_2					(THIRD_PARTY_EVENT_ID_MIN + 7143)
#define EVT_CONTROL_STAND_FLAPS_LEVER_5					(THIRD_PARTY_EVENT_ID_MIN + 7144)
#define EVT_CONTROL_STAND_FLAPS_LEVER_10				(THIRD_PARTY_EVENT_ID_MIN + 7145)
#define EVT_CONTROL_STAND_FLAPS_LEVER_15				(THIRD_PARTY_EVENT_ID_MIN + 7146)
#define EVT_CONTROL_STAND_FLAPS_LEVER_25				(THIRD_PARTY_EVENT_ID_MIN + 7147)
#define EVT_CONTROL_STAND_FLAPS_LEVER_30				(THIRD_PARTY_EVENT_ID_MIN + 7148)
#define EVT_CONTROL_STAND_FLAPS_LEVER_40				(THIRD_PARTY_EVENT_ID_MIN + 7149)

and my script:-

Var 0110, name FlapLeverCtrl, Link FSUIPC_OUT, Offset $3110, Length 8 // For the control ID

Var 0112, name flapPOT_MOVED, Link SUBRUTINE
{
  IF &flapPOT <= &flap1
  {
    &FlapLeverCtrl = 76773              // flaps up	
  }
  ELSE
  {
    IF &flapPOT <= &flap2
    {
      &FlapLeverCtrl = 76774          // flaps 1	  
    }
    ELSE
    {
      IF &flapPOT <= &flap5
      {
        &FlapLeverCtrl = 76775         // flaps 2 		
	  }
      ELSE
      {
        IF &flapPOT <= &flap10
        {
          &FlapLeverCtrl = 76776         // flaps 5 		  
        }
        ELSE
        {
          IF &flapPOT <= &flap15
          {
            &FlapLeverCtrl = 76777         // flaps 10             		
          }
          ELSE
          {
            IF &flapPOT <= &flap25
            {
              &FlapLeverCtrl = 76778         // flaps 15               		  
            }
            ELSE
            {
              IF &flapPOT <= &flap30
              {
                &FlapLeverCtrl = 76779         // flaps 25                			
              }
              ELSE
              {
                IF &flapPOT <= &flap40
                {
                  &FlapLeverCtrl = 76780         // flaps 30                  				  
                }
                ELSE
                {
                  &FlapLeverCtrl = 76781         // flaps 40                  			  
                }
              }
            }
          }
        }
      }
    }
  }
}

Var 0113, name flap0, static, Value 0

Var 0114, name flap1, static, Value 31

Var 0115, name flap2, static, Value 59

Var 0116, name flap5, static, Value 95

Var 0117, name flap10, static, Value 128

Var 0118, name flap15, static, Value 158

Var 0119, name flap25, static, Value 188

Var 0120, name flap30, static, Value 211

Var 0121, name flap40, static, Value 235

 
Posted : December 29, 2025 6:57 pm
(@fsuipc)
Posts: 113
Admin
 

Please read the FAQ entry again, and also how to use offset 0x3110.
You are calculating the control number correctly, but you also need to write the parameter value, which is most probably a left-mouse click, i.e. you also need to write 0x20000000 to 0x3114 (as 4 bytes), then write your control number to 0x3110 as 4 bytes, not 8. Or you can write all 8 bytes together if you prefer (although I am not sure how you would do that in SIOC).

Please also note that this is a FAQ entry. I do not mind short questions to clarify what is written in the entry, but for more detailed issues and support , please post in the appropriate support forums.

John


 
Posted : December 29, 2025 7:21 pm
(@skythelimit)
Posts: 19
Registered
 

Perfect, that’s it John, thanks SO much!  Here is the final working script if anyone needs it:

Var 0110, name FlapLeverCtrl, Link FSUIPC_OUT, Offset $3110, Length 4 // For the control ID

Var 0111, name FlapParam, Link FSUIPC_OUT, Offset $3114, Length 4 // For the parameter

Var 0112, name flapPOT_MOVED, Link SUBRUTINE
{
  IF &flapPOT <= &flap1
  {
    &FlapParam = 536870912
	&FlapLeverCtrl = 76773          // flaps up	
  }
  ELSE
  {
    IF &flapPOT <= &flap2
    {
      &FlapParam = 536870912
	  &FlapLeverCtrl = 76774      // flaps 1	  
    }
    ELSE
    {
      IF &flapPOT <= &flap5
      {
        &FlapParam = 536870912
		&FlapLeverCtrl = 76775     // flaps 2 		
	  }
      ELSE
      {
        IF &flapPOT <= &flap10
        {
          &FlapParam = 536870912
		  &FlapLeverCtrl = 76776  // flaps 5 		 
        }
        ELSE
        {
          IF &flapPOT <= &flap15
          {
            &FlapParam = 536870912
			&FlapLeverCtrl = 76777         // flaps 10 	            		
          }
          ELSE
          {
            IF &flapPOT <= &flap25
            {
              &FlapParam = 536870912
			  &FlapLeverCtrl = 76778         // flaps 15               		  
            }
            ELSE
            {
              IF &flapPOT <= &flap30
              {
                &FlapParam = 536870912
				&FlapLeverCtrl = 76779         // flaps 25               				
              }
              ELSE
              {
                IF &flapPOT <= &flap40
                {
                  &FlapParam = 536870912
				  &FlapLeverCtrl = 76780         // flaps 30                   			  
                }
                ELSE
                {
                  &FlapParam = 536870912
				  &FlapLeverCtrl = 76781         // flaps 40	                 			  
                }
              }
            }
          }
        }
      }
    }
  }
}

Var 0113, name flap0, static, Value 0

Var 0114, name flap1, static, Value 31

Var 0115, name flap2, static, Value 59

Var 0116, name flap5, static, Value 95

Var 0117, name flap10, static, Value 128

Var 0118, name flap15, static, Value 158

Var 0119, name flap25, static, Value 188

Var 0120, name flap30, static, Value 211

Var 0121, name flap40, static, Value 235

 
Posted : December 29, 2025 7:38 pm
FSUIPC reacted