Jump to content
The simFlight Network Forums
Sign in to follow this  
Guido

MCP-Pro button read

Recommended Posts

Hi Pete

After my difficulties controlling throttle I wanted to do something easy! I wanted to read keys from MCP-Pro and assign a new function (for Airbus use).

The tests with my Joystick was no problem. FSUIPC button asignment window shows Joy# 0 and button 2. The button is detected at (32FF) and which one selected via (2910).

But the MCP-Pro shows in FSUIPC Joy# 158 buttons 11,12,13. The joystick number is out of range! How should I handle this correctly? Any idea?

Sorry for bother you again but this is the “last” thing I wanted to do for now.

Rgds

Share this post


Link to post
Share on other sites

But the MCP-Pro shows in FSUIPC Joy# 158 buttons 11,12,13. The joystick number is out of range!

Out of range for what? FSUIPC deals with joystick assignments up to 255 locally, and much higher for buttons on WideFS client PCs. (1000 added for each PC).

Regards

Pete

Share this post


Link to post
Share on other sites

Out of range for what? FSUIPC deals with joystick assignments up to 255 locally, and much higher for buttons on WideFS client PCs. (1000 added for each PC).

Regards

Pete

Hi Pete

Maybe I don’t understand the access or numbering method. Reading the description for offset

2910:

Byte 0 (bits 0-7): Joystick number (0-15) + 128. In other words 128 for Joystick 0, 129 for joystick 1, etc.

Byte 1 (bits 8-15): Button number (0-39)

The FSUIPCs Joystick assignment window shows joy# 158 and the button window 11, 12, 13 when pushing the MCP-Pro buttons.

If the "joystick" number is already > 128 (like # 158) then the sum is out of range for Byte 0.

What I don't understand is how to calculate the right "joystick" number for byte 0 of offset 2910.

What I want to do is to assign Wilco A320 specific commands to 3 push buttons on my MCP-Pro.

Thank you for your help.

Rgds

Guido

Share this post


Link to post
Share on other sites

Maybe I don’t understand the access or numbering method. Reading the description for offset

2910

Ah. Offset 2910 is for "Hot Button" programming and only operates with regular locally connected DirectInput joysticks.

What I want to do is to assign Wilco A320 specific commands to 3 push buttons on my MCP-Pro.

Why not simply assign them? Why are you writing a program to use Hot Buttons?

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete

I want to emulate the Airbus FCU’s push/pull button functions with MCP-Pro’s rotary knops push button event to switch between managed and unmanaged mode. In the pilots guide I could not find a key code for this function. But by using Eric’s exporter interface it would be easy to implement it. The “only” problem is that I cannot detect the “key” event. As FSUIPC does detect it in the button assignment window I hope to have a chance to detect it somehow through it. But how is the question! Can you help?

Thanks for your support. It is really excellent.

Rgds

Guido

Share this post


Link to post
Share on other sites

I want to emulate the Airbus FCU’s push/pull button functions with MCP-Pro’s rotary knops push button event to switch between managed and unmanaged mode. In the pilots guide I could not find a key code for this function.

Isn't it accessible either via mouse macro or L:var methods?

But by using Eric’s exporter interface it would be easy to implement it.

This is where I'm not seeing the picture. Is this a programmable interface? Are you writing a program to interface both to FSUIPC and to this other program?

The “only” problem is that I cannot detect the “key” event. As FSUIPC does detect it in the button assignment window I hope to have a chance to detect it somehow through it. But how is the question!

You can assign the buttons to anything which you can detect. If you have decided you must write a program to do it, you could use the Offset Byte SetBits and Offset Byte Clearbits controls to change bits in a user byte offset, such as 66C0 (offsets 66C0 to 66FF are assigned for users).

I would still like to know a bit more. There aren't many aircraft add-ons which are not amenable to some sort of assignment method or another.

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete

I am one of the 3D cockpit users and therefore I think mouse macros will not work.

Until now I did not study LUA and I guess I would need a variable list. Do you know a good link to learn and start with LUA?

For Wilco’s A320 is an interface available called exporter to control A320 specific commands.

I am using it already to manage the altitude information. I read through FSUIPC the commanded altitude in FSX (coming from my MCP-Pro) and write it through the exporter to the A320s virtual FCU.

What I want to do now is to detect some MCP-Pro button event via FSUIPC “inside” FSX (I am not using the MCP-Pro development kit) and then write the event into the exporter interface. The trouble is that I do not know how to detect the MCP-Pro button event (#158/11,12,13) via FSUIPC and FSX. The rest is no problem as I did test it with a joystick button event (offsets 32FF, 2910 and joystick #0/button 2).

I hope there is a way to detect the event via FSUIPC. I am not sure what I can do with offset 66C0 as it is for general use. Can I use it to detect “joystick” number 158 button 11? I guess not.

I am sorry for my not so usual “miss use” of FSUIPC.

I am also happy if another easier method exist to do the same.

Many thanks for your help.

Rgds

Guido

Share this post


Link to post
Share on other sites

I am one of the 3D cockpit users and therefore I think mouse macros will not work.

I'm not sure why 3D versus 2D makes any difference. "Mouse macros" don't use the mouse or its position. They replace the use of the mouse once FSUIPC has detected what happen when the mouse is used.

Until now I did not study LUA and I guess I would need a variable list. Do you know a good link to learn and start with LUA?

I don't remember mentioning Lua. I mentioned "L:Vars", which is short for "Local Variables". There are facilities in FSUIPC for finding out about local variables -- even an assignable control to list them. True, you would probably need a Lua plug-in to write to them, but that's no where near the first step.

What I want to do now is to detect some MCP-Pro button event via FSUIPC “inside” FSX (I am not using the MCP-Pro development kit) and then write the event into the exporter interface. The trouble is that I do not know how to detect the MCP-Pro button event (#158/11,12,13) via FSUIPC and FSX.

Didn't I suggest the solution to that? Assign the button to one of the Offset controls so that it changes the offset in a way you can detect in your program. You seem to miss half of what I write.

I hope there is a way to detect the event via FSUIPC. I am not sure what I can do with offset 66C0 as it is for general use. Can I use it to detect “joystick” number 158 button 11? I guess not.

Offsets 66C0 to 66FF are for any use you want to put them to. That's why I mentioned them. Of course you can use them to detect your button. Just assign your button to change the offset as you wish. This is what the Offset controls, in the drop-down assignments list is for !!!!!

I am sorry for my not so usual “miss use” of FSUIPC.

There is no "mis-use". Sorry to have to repeat myself, but you seem to be ignoring the things you can do, even though I point them out.

Regards

Pete

Share this post


Link to post
Share on other sites

Hi Pete

Sorry I did not catch it the first time.

The advanced users guide was not part ot the initial down load package and I mixed it with the users & programmers guide.

Again sorry about that.

Now things are clear.

Rgds

Guido

Share this post


Link to post
Share on other sites

Sorry I did not catch it the first time.

That's okay. When you have a lot of puzzles on your mind it is easy to miss things in front of you! ;-)

The advanced users guide was not part ot the initial down load package

Er ... it is installed in the FSUIPC Documents folder, inside the FS Modules folder, when you install FSUIPC. It's always been part of the FSUIPC package, not the SDK.

Now things are clear.

Good. Hope it all works as you wish it to!

Regards

Pete

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

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.