Jump to content

**V440 UPDATE** In-depth tutorial to bind SWITCHES and PUSH-BUTTONS to keyboard or hardware for the A3XX


Alexandre K

Recommended Posts

Alexandre K

TABLE OF CONTENTS

I. INTRODUCTION
II. ROTORBRAKE CODES
III. FSUIPC MACRO

 

1. INTRODUCTION:

Greetings,

Since many people were asking in different topics and even in PMs, I'm doing this quick - but yet in-depth - tutorial on how to bind SWITCHES and PUSH-BUTTONS (but literally anything is possible) on the FSLabs A3xx. For those who are asking themselves what I mean by the above sentence : ever fancied binding your PACKS to your keyboard or a hardware button in order to avoid looking at them while doing a 30° bank turn 10 s after departure and ending up triggering this wonderful add-on protections ? This tutorial is for you ;)

Hope it helps!

CAUTION: This tutorial requires FSUIPC and P3Dv4.4 or greater ! It is possible that, from a Prepar3D or FSLabs version to another (P3Dv4.4 to P3Dv4.5 OR FSLabs v400 to FSLabs v412) you have to redo some of your binds.

To make those "binds", you have two options. The first is what I call the "Rotorbrake code" way, with this you'll be able to bind most (if not all) switches of the aircraft such as all lights, seatbelt signs, no smoking signs, all TCAS knobs etc. However, you can as well make a macro. If you follow the exact steps listed in this tutorial everything is going to be fine, so let's get started !

2. ROTORBRAKE CODES:

2.1 Find the code

First of all, you'll need to get those "codes" and you'll understand the Rotorbrake part later.

Launch your simulator and load the FSLabs.

In the FSUIPC > Logging menu, check "Events (non-axis controls)" and "Send to console window". You may want to reduce temporarily your P3D screen size in windowed mode so it is easier.

image.png.c8a05ee0697a937aa9522ed61ece55ed.png

Now, click OK, and gather the needed codes by clicking on the things you would want to bind. (Usually on knobs such as the Transponder mode, there will be one value to decrease - left click - and one value to increase - right click.)

When you are done gathering, you may uncheck the above boxes in Logging to resume normal operations.

2.2 Go in >FSUIPC in your sim's menu.
Then in the submenu "Key Presses" if you want to assign the command to a keyboard bind (or "Button + Switches" for a hardware bind - works the same way).
2.3 Click on "Set"
Press the key you want to bind.
2.4 In "Control sent when keys pressed" select "Rotor Brake".
2.5 In "Parameter" enter the code.

2.6 Click "Confirm"

Eg: pressing my Num8 key will decrease by one the transponder mode (on the version of the tutorial's date). From TA/RA to RA or from RA to STBY.

image.png.00ce542d93c608b2cd60faae5f784c94.png

 

2.7 Repeat the operation for all other codes !

3. FSUIPC MACROS:

As I told you, if you want to bind push-buttons this is the option. To do so, either refer to FSUIPC's manual which gives much more information or follow this guide :

3.1 Go in your >FSUIPC sim menu.

Then, either go in "Key presses" or "Buttons + Switches" (does not matter) and click on "Create Mouse Macro".

image.png.0702f46028489859e6ac443a564b8141.png

3.2 Name your macro

Read carefully the instructions and name your macro. In this example, "ABC" :

image.png.a99dece0eb0f9af51f64630ab8298b0a.png

3.3 Click OK twice

Once to exit the "Mouse action Macro making" window once the name has been inserted and another time on the FSUIPC main menu to go back to the sim. You'll be in macro mode.

3.4 Click on the item part of the macro

Click in the VC ! If you want PACK 1 to be triggered by this macro, simply click at the middle of the PACK 1 p-b. Once a click is done, you should see this message (I suggest you repeat the initial's macro name but it can be different) :

image.thumb.png.b49599ab06d754533b75b6f3afc7e35b.png

If your macro is finished, simply go back to the FSUIPC menu. If not, you can do multiple clicks and repeat this operation and finally go back to FSUIPC main menu.

3.5 Back to the FSUIPC main menu

Click on "Key presses" or "Buttons + Switches" submenu and click on "End Macro Making".
image.png.20e0dc22956501cb5ef7860ee04fa8bc.png

3.6 Bind your macro

To bind your macro, do as normal except in "Control sent when keys pressed" find your macro's name. In this example, "ABC" :
image.png.065e8a14303ac64e599155c3db33790d.png

Don't forget to hit Confirm ;)

--

Note: The most common macro being looked for is the handy engine master switch. The macro is tricky to make as it needs editing and I understand some of you might not want to waste time on that. That's why from now on, after each FSLabs version, I'll update a working macro of ENG 1 and ENG 2 MASTER SW if needed.

The macro will, with one bind (keybind or hardware button/switch), lift - move - unlift the master switch. Long story short : you can start or shutdown one engine with one bind.

Simply copy [VERSION][AIRCRAFT]ENG1.MCRO and [VERSION][AIRCRAFT]ENG2.MCRO in [...]\Lockheed Martin\Prepar3D v4\Modules and then bind your macros by following the 3.6 step, looking for the name of the macro file.

--

Note 2: /!\ Sometimes, even if you stayed on the same FSLabs or Prepar3D version, I noticed that some macros might not work anymore for some reason. The fix is to restart your sim.

 

 

The "A320" macros as well work for the A319.
The v434 A320/A319 macros work as well for v440.

v434A320ENG2.MCRO v434A320ENG1.MCRO v434A321ENG1.MCRO v434A321ENG2.MCRO

Edited by Alexandre Kubatko
  • Like 10
  • Thanks 17
Link to post
  • Replies 112
  • Created
  • Last Reply

Top Posters In This Topic

  • Alexandre K

    17

  • NilsUnger

    10

  • Peter Pukhnoy

    9

  • Marco Serwatka

    6

Top Posters In This Topic

Popular Posts

TABLE OF CONTENTS I. INTRODUCTION II. ROTORBRAKE CODES III. FSUIPC MACRO   1. INTRODUCTION: Greetings, Since many people were asking in different topics and even in PMs, I

In case someone would prefer the 'rotorbrake' command to macros for the actions which aren't in actions.lua, I've made a list of the 'rotorbrake' control parameters for such actions. The actions that

Posted Images

NilsUnger

One important advantage of the script method is the possibility to assign multiple actions with one trigger event. Look at my scripts below and see how I toggle the engine master switches or both packs at once. Alexandre, maybe you can add it to your opening post, if you wish?

Quote

[Macros]
1=Strobe_DEC=RX40000114,3
2=Strobe_INC=RX40000114,1
3=Dome_INC=RX40000109,1
4=Dome_DEC=RX40000109,3
5=Altimeter_STD_P=RX40000120,1
6=Altimeter_STD_R=RX40000120,11
7=APU_Start=RX24403807,3
8=APU_Master=RX24403806,3
9=TO_CONFIG_P=RX40000169,3
10=TO_CONFIG_R=RX40000169,13
11=ENG1
11.1=RX4000014F,1
11.2=RX4000014F,3
11.3=RX4000014F,13
11.4=RX4000014F,11

12=ENG2
12.1=RX4000014E,1
12.2=RX4000014E,3
12.3=RX4000014E,13
12.4=RX4000014E,11

13=TurnoffToggle=RX40000115,3
14=PacksToggle
14.1=RX24402800,3
14.2=RX24402801,3

EDIT: I just realized you already put macros to your post showing the engine switches... :lol:

Edited by NilsUnger
Link to post
  • Norman Blackburn pinned this topic
Jean-Claude BÉGUIN

Thank you Alexandre,

Great tutorial. Bravo

I've also worked a lot on the "rotor brake" codes and LUA scripts but not yet find the time and skill to write a tuto like yours in the forum.

As you said, we can almost manage any action on the input side. The output side however is much of a problem....

Does anyone know how to read the autopilot values  (HDG, ALT, VS, etc....)  we can display them on a MAX7219 ?

I'm deadly missing those in my mini Arduino home cockpit.... 

Reading all the related posts in this forum, we're a bunch of us hoping FSL will release some information about how to access these basic values so we can enjoy a simple home cockpit without waiting for a high-end SDK (payware) tool which is not required for the "non-hard-core-cockpit-builders" folks like me... (us...)

Fingers crossed :unsure: 

 

  • Like 1
Link to post
Jürgen Heuwetter

Oh, wow, can't believe I haven't used the macro function to this day! I already used hellofalot assignments with the rotor brake parameter, but packs was something I really missed! Now it works!! BIG thumbs up and Thank You! B)

  • Like 1
Link to post
stephanhaas

Nice tutorial. However, I'm having trouble creating a mouse macro for the autobrake buttons. Macro doesn't seem to work. Anybody an idea?

Link to post
Jean-Claude BÉGUIN

Hello Stephan,

autobrakes seem to require 2 actions : push + release button

Using the famous rotorbrake code (66587) + the required parameter you can simulate the autobrake buttons :

For autobrake low :

- 66587+75159 (push) - 66587+75161 (release)

For autobrake med :

- 66587+75163 (push) - 66587+75165 (release)

For autobrake Max :

- 66587+75167 (push) - 66587+75169 (release)

you can execute these actions with a simple LUA script through FSUIPC

eg : for "autobrakes low", the script is :

FSL = 66587
ipc.control(FSL,75159)
    ipc.sleep(200)
ipc.control(FSL,75161)
    ipc.sleep(80)

this works fine on my PC, hope it'll work on yours

cheers

J.-C.

  • Like 1
Link to post
stephanhaas

Thanx! Not sure how to invoke a script, but the rotor brake codes in FSUIPC worked like a charm.

Link to post
mmoore0324

Thanks so much for this. Really enhances the aircraft. 

  • Thanks 1
Link to post
  • 3 weeks later...
Peter Pukhnoy

In case someone would prefer the 'rotorbrake' command to macros for the actions which aren't in actions.lua, I've made a list of the 'rotorbrake' control parameters for such actions. The actions that already are in actions.lua should be there, too - as well as things like moving the seats and the sun shades.

Most pushbuttons are assigned two parameters - one to press and the other one to release. There's a comment for each parameter telling whether its action is to press or to release a switch. Some switches can only be toggled, in which case there will be only one comment. For example, you'll find:

VC_OVHD_AC_Pack_1_Button = 72398, -- to release
VC_OVHD_AC_Pack_2_Button = 72402, -- to release

Using the parameter 72398 will either press or release the Pack 1 switch. Another example is the APU_MASTER switch that will be pressed and released with one toggle parameter.

Of course, you can create a Lua script for separate press and release actions using the toggle parameters.

Here's an example showing how you would map the EXT PWR switch to a key: 

example.jpg.e9365b01c38b9f616124b0d08f2120aa.jpg

 

rotorbrake_param_list.txt

  • Like 2
  • Thanks 3
Link to post
Peter Pukhnoy
11 minutes ago, NilsUnger said:

Does anybody know how I can close the doors with a script? They are not in the list.

'Toggle aircraft exit' with different parameters: 0-4 for the pax exits, 8-10 for the cargo doors.

Link to post
Peter Pukhnoy
2 minutes ago, NilsUnger said:

What would be the codeline in a lua?

For 1L it would be: 

if ipc.readLvar("FSLA320_pax_door1") > 0 then
ipc.control(66389,0)
end

search for "door" in the attached list for the rest of the doors

list of Lvars.txt

  • Thanks 1
Link to post
Alexandre K
6 hours ago, jaime eguren said:

 

but I have the switch panel and I don't know how to configure it

Sorry I don't know what it's that. If you go in your controls of P3D you can bind the gear up or down toggle.

 

 

55 minutes ago, Peter Pukhnoy said:

Does anyone know if there's a way to change which sidestick is animated other than through the MCDU options?

I guess @Andrew Wilson or @Norman Blackburn should know ? Sorry for the tag :D

Link to post
Jean-Claude BÉGUIN

Thanks Peter, 

Indeed this works to get the FCU values in a browser.

My next challenge is to have these values read by Mobiflight so they can be displayed on 7 segments LED's..  Mobiflight can only read FSUIPC offsets.

Any idea how to copy these values in the FSUIPC user offsets (66C0 and above) whenever they change (event..) 

And by the way, do you know any other Localhost displays available ?

Thank you

Jean-Claude

 

Link to post
Peter Pukhnoy
1 hour ago, Jean-Claude BÉGUIN said:

Thanks Peter, 

Indeed this works to get the FCU values in a browser.

My next challenge is to have these values read by Mobiflight so they can be displayed on 7 segments LED's..  Mobiflight can only read FSUIPC offsets.

Any idea how to copy these values in the FSUIPC user offsets (66C0 and above) whenever they change (event..) 

And by the way, do you know any other Localhost displays available ?

Thank you

Jean-Claude

 

Drop it in the Modules folder and start it by assigning to a key the command 'Lua FCU'. A display will come up showing the heading.  On my PC, the FPS dropped a little, but that's just because of the display.

FCU_test.zip

The MCDU displays are at http://localhost:8080/MCDU/Display/3CA1 and http://localhost:8080/MCDU/Display/3CA2.

Link to post
  • 2 weeks later...
Vincent Twisker
9 minutes ago, Graham Carr said:

@Alexandre Kubatko Thanks for the write up and the engine macros.

I'm not going to pretend I understand how to create the macros, is it possible to get macros to turn off the engines as well?

If you read this topic from the beginning, you would be surprised.

Link to post
Alexandre K
1 hour ago, Graham Carr said:

@Alexandre Kubatko Thanks for the write up and the engine macros.

I'm not going to pretend I understand how to create the macros, is it possible to get macros to turn off the engines as well?

No problem. The macros available for download are toggle. They work either to start the engine or shut it down :)

1 hour ago, Marco Serwatka said:

@Alexandre KubatkoThat does the trick, thanks. 

 

I've now unlocked a new skill: Shutting down an engine on the go without taxing onto the grass. B)

Ahah yes, very nice addition to be able to do it while not looking at the overhead panel :D

Link to post
Günter Steiner

 

It have been a slight sign of politeness to ask us, or even give some credits as this is the main work of "your" tutorial here.

<_<

 

Yes, LINDA is freeware and we always give permissions to use our codes and scripts, but ... what should I say, it's all about politeness.

Have fun with it anyway

 

  • Like 1
Link to post
Graham Carr
3 hours ago, Alexandre Kubatko said:

No problem. The macros available for download are toggle. They work either to start the engine or shut it down :)

Thanks for the info, I have just tried it and they work perfectly. I have also made new macros for other switches on the pedestal and overhead. I can pretty much continue looking straight ahead whilst flying and taxing now.

  • Like 1
Link to post
  • 4 weeks later...
David Gray

I have a question on all this.  I just dabbled around and see using a rotorbrake code I can successfully turn off and on landing lights.  However how does one go about implementing these types of settings if you fly other types of aircraft.  For instance.  The buttons I've mapped to the Landing gear on and off now works to control the FSLA320 landing lights.  But ideally I'd like to use that same switch to do the same in the 737.  See my question?

Link to post
NilsUnger
3 hours ago, DAVID GRAY said:

But ideally I'd like to use that same switch to do the same in the 737.  See my question?

I don't know the details behind this but I am almost sure that rotorbrake codes are unique to a certain add-on / virtual cockpit. 

For what you want, you would need to setup different FSUIPC profiles for your add-ons.

Link to post
Nadim Janjua

Hi all,

I'm having trouble with the codes for RUDDER TRIM. I managed to obtain the newer codes via the LUA action script

...But the action seems to be of the latched type and not a toggle. I.e. pressing my button once keeps the switch latched. The button works perfectly when assigned to another control so the hardware is fine. Anyone manage to resolve this?

Link to post
Graham Carr

Has anyone else's switch assignments "broken" with the A321?

They are all fine in the A319 and A320, but the majority don't work properly on the A321 - different switches move!

Link to post
NilsUnger
12 minutes ago, Graham Carr said:

Has anyone else's switch assignments "broken" with the A321?

They are all fine in the A319 and A320, but the majority don't work properly on the A321 - different switches move!

Yes, most of my bindings done with mouse macros don't work anymore. It's not much work to correct that, though. The bindings done with rotorbrake codes seem to be okay.

Link to post
Graham Carr
On 12/24/2019 at 9:00 PM, NilsUnger said:

Yes, most of my bindings done with mouse macros don't work anymore. It's not much work to correct that, though. The bindings done with rotorbrake codes seem to be okay.

The only difference I have now is the Engine master switches. The macro above doesn't work for the A321 but still works on the latest A319/A320.

Does anyone know if it is possible to have 1 macro that covers the A319/320/321? All of my attempts have failed, miserably.

Link to post
Alexandre K

Hello,

Unfortunately I won't buy the A321 so I cannot possibly provide the macro.

However, someone has already asked me this question in PM so I'll send the same instructions, if you do that I will be able to upload a macro file :

  • Create a macro following my tutorial where you will left click on ENG master 1
  • Create another macro following my tutorial where you will left click on ENG master 2
  • Send me the two files

From there, I can edit the files and send them back. It's a little bit tricky because you have to edit the macro file, but if your sim is active, you have to "refresh" your macro database by creating another macro. But if you provide me the two files it's a 10 sec fix :D

Edit: Thanks, A321 macros are now up.

Edited by Alexandre Kubatko
Link to post
  • Norman Blackburn unpinned this topic
Alexandre K

Make sure, for those in needs of the thread, to bookmark it.

Slightly modified the tutorial to remove links and references to their publicly available to download .zip file - which is absolutely not needed for my tutorial to work !

Edited by John Barnes
  • Like 1
Link to post
  • Norman Blackburn pinned and unpinned this topic
Koen Meier

May I ask how this can be solved in a friendly manner, one that benefits our community instead of bashing it. I get that some people spend their time in finding codes for the benefit of our community. How can this topic help others who want to use macros in the long run.

  • Like 3
  • Thanks 1
Link to post
Xander Koote

I managed to make a standard binding using the rotor brake codes where on my Saitek Throttle Quadrant, you first push one button, and then a second to action the switch. I really like it! Thanks a lot for this tutorial...

  • Thanks 1
Link to post
  • Bob Lyddy pinned this topic

×
×
  • Create New...