Jump to content
The simFlight Network Forums

[MSFS] [DEPRECATED] How to program joystick buttons and keys to control PMDG aircraft


Paul Henty

Recommended Posts

NOTE: This guide references an out-dated method for controlling the PMDG aircraft in MSFS. While it might still work, a better method is explained in this linked FAQ:

 

Background

PMDG Aircraft for MSFS do not 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 send codes as a parameter to the standard MSFS 'Rotor Brake' control. The parameter code specifies which switch to operate and what type of mouse click to simulate.

The control numbers 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 'Rotor Brake' parameter codes
  3. How to assign the code to buttons/keys in FSUIPC

The specific examples shown will be taken from the PMDG 737-700, but the same method works for any PMDG aircraft with an SDK.

 

1. Locating the SDK

  • From your main Flight Sim install folder, open the PMDG folder.
  • Then select the folder belonging to the aircraft you want to use. e.g. PMDG 737 NGXu
  • Then select the SDK folder
  • Locate the file with the .h extension. For the 737 it's called PMDG_NG3_SDK.h
  • You can open this file with Notepad or your favourite text editor.

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

[FlightSimInstallFolder]\PMDG\PMDG 737 NGXu\SDK\PMDG_NG3_SDK.h

 

2. Calculating the 'Rotor Brake' Parameter Code 

2.1. 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" switch 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 ignore THIRD_PARTY_EVENT_ID_MIN and take the number after it. In this case 402.

NOTE: Some controls reference other controls. For example:

#define EVT_EFB_L_BACK									(EVT_EFB_L_START + 1)

For this you need to find the value of EVT_EFB_L_START and add 1. Searching for EVT_EFB_L_START we find this:

#define EVT_EFB_L_START									(THIRD_PARTY_EVENT_ID_MIN + 1700)

As before, THIRD_PARTY_EVENT_ID_MIN is always ignored. So we get the value of 1700.

Adding 1 to this will give us the value for EVT_EFB_L_BACK. Therefore EVT_EFB_L_BACK would be 1700 + 1 = 1701.

We have now calculated the control number. 

 

2.2. Adding the Mouse Action Code

You now need to add a number to tell the aircraft what kind of mouse interaction you want to simulate. (e.g. left click, right click, scroll wheel up).

First multiply the control number you have so far by 100. In our example for EVT_MCP_CMD_A_SWITCH we get:

402 * 100 = 40200

Now you ADD the following number, depending on the mouse operation you want:

1 for left mouse click
2 for right mouse click
3 for mouse move
4 for left mouse button release
5 for right mouse button release
6 for middle mouse button click
7 for mouse wheel up
8 for mouse wheel down

For our example, we'll have our key assignment simulate the left mouse button clicking on the CMD A autopilot button. So we'll need to add 1:

40200 + 1 = 40201

Now we have the final code number.

 

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

Select [Assignments] -> [buttons + switches] or [key presses] in the FSUIPC7 menu. Then select the button or key to program.

From the "control sent..." dropdown select Rotor Brake

In the Parameter field below type in your calculated code number from the previous step. For our 'Autopilot CMD A' example, we enter 40201 

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.faa9e5aa0352df1669b1b95b50b81f15.png

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

  • Thanks 1
Link to comment
Share on other sites

Quote

Is it possible to have access to Rotary Encoders too?

Only if your encoders can be seen by FSUIPC as joystick button presses. This will depend on the drivers\software you use to read the encoders.

Some encoders can be set up to simulate a joystick button press when they are rotated left, and another button when rotated right. Sometimes you will get two buttons for each direction, one for a slow turn and one for a fast turn. In this case you just use the encoders as if they were joystick buttons in FSUIPC, using the method described above.

If your encoders cannot be set up like this then you won't be able to use the switches/buttons method described above. You will need to use different software to read the encoders and send the controls directly to FSUIPC. What that software is will depend on the specific hardware you are using.

Paul

  • Like 1
Link to comment
Share on other sites

23 minutes ago, JackSwyr said:

If it uses the Rotor Brake control, does this mean that you can only program one event in the Rotor Brake?

No - you can assign to any event, with the parameter of the Rotor Brake control indicating the button/switch as well as the mouse action, as indicated in these instructions.
Note that these days it is easier to use the presets for the PMDG 737. These come with FSUIPC7, but you can use the MobiFlight HubHob site to search and see what is available for this aircraft: https://hubhop.mobiflight.com/presets/

John

Link to comment
Share on other sites

6 hours ago, John Dowson said:

No - you can assign to any event, with the parameter of the Rotor Brake control indicating the button/switch as well as the mouse action, as indicated in these instructions.
Note that these days it is easier to use the presets for the PMDG 737. These come with FSUIPC7, but you can use the MobiFlight HubHob site to search and see what is available for this aircraft: https://hubhop.mobiflight.com/presets/

John

Thanks John.

Link to comment
Share on other sites

  • 1 month later...

I have the PMDG 737-600 for MSFS2020 but I cannot for the life of me find the .h file to find the values. I have tried fuzzy searching the root install folder for '*.h' but coming up blank. Can anyone help with this, desperate to pair the controls up to a couple of Thrustmaster MFD's.

Link to comment
Share on other sites

The SDK for the MSFS PMDG 737-700 has still not been released, and so there is no SDK header file (*.h) at the moment. Folks are using the PMDG header file at the moment, which I have attached. Although you may be better looking on the PMDG support forums - I believe there is more information there on the Rotor Brake parameters, although I haven't checked for a while...

John

PMDG_NG3_SDK.h

Link to comment
Share on other sites

Perfect, this is what I was looking for, thank-you. I guess in the PMDG folder I would create the SDK folder and place the file in there? Is there anything to edit in that file to specify the 600 variant rather than the NG3 or does this not matter? 

I’m determined to operate the controls but I think I’m too early to the party for MSFS2020 and PMDG as the offsets I have tried, doesn’t seem to work. I am convinced it’s me, I’m learning quickly but if I can get 1 button to work in sim, the rest will be easy!

Thanks in advance. 

EDIT: 4 hours later, I have managed to get the Couger MFD buttons to now work some of the OHP on the 737-600. The above steps were correct, I just misread and missed out the whole Rotor Break bit. I'm too tired! Thank you for supplying that file, I'm now configuring the rest of the setup!

Edited by TheAgileBA
Link to comment
Share on other sites

12 hours ago, TheAgileBA said:

I guess in the PMDG folder I would create the SDK folder and place the file in there?

I wouldn't do that. Just keep it anywhere for now - the official version should be released at some point.

12 hours ago, TheAgileBA said:

Is there anything to edit in that file to specify the 600 variant rather than the NG3 or does this not matter? 

No. That file is not used at run-time - you just need it to determine the Rotor Brake parameters.

12 hours ago, TheAgileBA said:

EDIT: 4 hours later, I have managed to get the Couger MFD buttons to now work some of the OHP on the 737-600. The above steps were correct, I just misread and missed out the whole Rotor Break bit. I'm too tired! Thank you for supplying that file, I'm now configuring the rest of the setup!

👍

Link to comment
Share on other sites

  • Paul Henty changed the title to [MSFS] [OBSOLETE] How to program joystick buttons and keys to control PMDG aircraft
Just now, Paul Henty said:

've marked this method as obsolete now and linked to the other FAQ. I didn't want to delete it as it would create dead links on the forum. It might be an idea to unpin it though. (Or delete it if you don't mind the dead links.)

It is not obsolete - the Rotor Brake controls still function as explained in this post, but the Rotor Brake control has now been deprecated, which means they you should move away from using this as it may be removed in a future update, although I doubt very much that this will actually happen.

For clarity, instead of using the Rotor Brake control, you should now use the provided custom controls, which work in the same way as they did in P3D. Note that these are also more powerful, as they can be used with proper parameters as well as mouse codes (where appropriate).

I will therefore keep this topic, but will now lock it.

John 

Link to comment
Share on other sites

  • John Dowson changed the title to [MSFS] [DEPRECATED] How to program joystick buttons and keys to control PMDG aircraft
  • John Dowson locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.