Jump to content
The simFlight Network Forums

Problem with tab key presses usage...


Recommended Posts

Hello Peter,

First of all I allow myself to congratulate you for all the work which you provide for FSUIPC. I have used it for several years and really this program is fantastic and it gives me any satisfaction.

Today, I have a problem in trying to use FSUIPC 4,853, P3D 1.4, PMDG 737 NGX SP1C and a CDU Opencockpits V2 equipped with an interface USBKey which emulates a keyboard.

With this intention, I connect the CDU on an USB port of my computer, then I start a programme encoder_keys written by Opencockpits which allows mapper all the keys of CDU as one wishes it thanks to a file encoder_keys.ini. For example when I press on key A of my CDU, encoder_keys sends sequence CTRL+F10. I made all mapping while avoiding using the native orders P3d or then I removed them in P3d. I also paid attention not to use the sequence ALT which can pose problems.

In FSUIPC, I select the tab Key Presses, then I click on the Set button then I press on key A of my CDU. FSUIPC detects pressing the A key as ctrl+F10. So far everything is OK. From there, I select custom Control and enter 70205 (69632+573) which is offset PMDG for letter A of left CDU. I put 1 in parameter. If I make the test in this way, I initialize FSUIPC with this configuration and when I press A on the CDU, letter A is display correctly on CDU but if I press for the second time or for the third time on A, it does not occur anything any more. It is identical which I notch No repeats or not. If I add offset 70205 in the section Control key hand feels When released with parameter 0, then with each striking on key A, the A is displayed 2 times on the screen of CDU. And it is similar which I notch or not No repeats.

I have this same problem on all the keys of CDU (letters and functions).

In the FSUIPC4.ini :

[Keys]

"

"

"

"

111=N121,10,70205,1,70205,0

"

"

"

I browsed many forums but I did not find any information regarding this problem. Maybe I missed. In addition, my English in not so good. It does not help me.

Thank you in advance for your replay.

Cordially

Link to comment
Share on other sites

In FSUIPC, I select the tab Key Presses, then I click on the Set button then I press on key A of my CDU. FSUIPC detects pressing the A key as ctrl+F10. So far everything is OK. From there, I select custom Control and enter 70205 (69632+573) which is offset PMDG for letter A of left CDU.

Please do not confuse offsets (which are FSUIPC tokens for data in or out of FS) with control numbers. Your 70205 is a control number.

I put 1 in parameter. If I make the test in this way, I initialize FSUIPC with this configuration and when I press A on the CDU, letter A is display correctly on CDU but if I press for the second time or for the third time on A, it does not occur anything any more. It is identical which I notch No repeats or not.

It must be that your keyboard emulation is only ever sending a "KEYDOWN" and never a "KEYUP". If a KEYUP is never seen, then separate keystrokes can never be seen.

If I add offset 70205 in the section Control key hand feels When released with parameter 0, then with each striking on key A, the A is displayed 2 times on the screen of CDU. And it is similar which I notch or not No repeats.

Hmm. Strange. That implies that KEYUP is actually seen after all. So, it is possible that the PMDG implementation needs a different parameter with its 70205 control so it knows it is a new keypress. Can you tell me why you chose to set the parameter "1" in the first place? I don't use any PMDG products myself, but it seems to be something to do with their handling of these controls.

Please enable Key and Event logging in the Logging tab of FSUIPC and try again. Show me the Log section showing the results. If this shows that FSUIPC is doing its job correctly, which sounds to be the case, then I think your question is for PMDG.

BTW if you press A then B then A again, do you get ABA? If so then it sounds like the PMDG code looks for a change. If so, re-program the key Up control to something innocous -- if such a keypress exists (+603, +605 seem to be unassigned, for example?).

Regards

Pete

Link to comment
Share on other sites

Thank you Peter for your response. You are very responsive.

Actually I have a little trouble with the concept of offset and control. But I'll get there!

The tests I've done with the software encoder_keys writing in Notepad gives me the impression of being conclusive. Indeed the action keys on the CDU seem correct in Notepad.

I used the parameters 1 and 0 because this is what is written in the PMDG SDK :

This sample code sets the TAXI lights switch:

// Send another command only if there is no active command request

// and previous command has been processed by the NGX

if (Control.Event == 0)

{

Control.Event = EVT_OH_LIGHTS_TAXI; // = 69749

if (New_TaxiLightSwitch)

Control.Parameter = 1;

else

Control.Parameter = 0;

SimConnect_SetClientData (hSimConnect, PMDG_NGX_CONTROL_ID,

PMDG_NGX_CONTROL_DEFINITION,

0, 0, sizeof(PMDG_NGX_Control), &Control);

}

In this case, the transmitted event is EVT_OH_LIGHTS_TAXI. The

available events are listed in the PMDG_NGX_SDK.h file. The control

parameter in this case is either 0 or 1 and determines the position the

switch should be placed into.

Note how the code checks that the NGX has no pending events to

process by checking that Control.Event == 0.

In fact if I configure the following FSUIPC and if I press the keys A and B then A then it appears AABBAA

for A :

ctrl+F10 ; Control sent when keys pressed : 70205 ; Parameter : 1 ; Control sent when main key released : 70205 ; Parameter : 0 ; No repeats!

for B :

ctrl+F9 ; Control sent when keys pressed : 70206 ; Parameter : 1 ; Control sent when main key released : 70206 ; Parameter : 0 ; No repeats!

and the log of this action :

********* FSUIPC4, Version 4.853 by Pete Dowson *********

User Name="Gérard N"

User Addr="gerard.n@orange.fr"

FSUIPC4 Key is provided

WideFS7 Key is provided

2444769 System time = 07/11/2012 00:16:15, Simulator time = 17:05:48 (15:05Z)

[Continuation log requested by user]

Running inside Prepar3D on Windows 7

Module base=5AA20000

2450182 KEYDOWN: VK=17, Waiting=0, Repeat=N, Shifts=2

2450182 .. Key not programmed -- passed on to FS

2450182 KEYDOWN: VK=121, Waiting=0, Repeat=N, Shifts=2

2450182 *** EVENT: Cntrl= 70205 (0x0001123d), Param= 1 (0x00000001) <70205>

2450182 FS Control Sent: Ctrl=70205, Param=1

2450182 .. This key is programmed in FSUIPC4 'Keys' options

2450182 KEYUP: VK=121, Waiting=0

2450182 *** EVENT: Cntrl= 70205 (0x0001123d), Param= 0 (0x00000000) <70205>

2450182 FS Control Sent: Ctrl=70205, Param=0

2450182 .. This key is programmed in FSUIPC4 'Keys' options

2450182 KEYUP: VK=17, Waiting=0

2452117 KEYDOWN: VK=17, Waiting=0, Repeat=N, Shifts=2

2452117 .. Key not programmed -- passed on to FS

2452117 KEYDOWN: VK=120, Waiting=0, Repeat=N, Shifts=2

2452117 *** EVENT: Cntrl= 70206 (0x0001123e), Param= 1 (0x00000001) <70206>

2452117 FS Control Sent: Ctrl=70206, Param=1

2452117 .. This key is programmed in FSUIPC4 'Keys' options

2452117 KEYUP: VK=120, Waiting=0

2452117 *** EVENT: Cntrl= 70206 (0x0001123e), Param= 0 (0x00000000) <70206>

2452117 FS Control Sent: Ctrl=70206, Param=0

2452117 .. This key is programmed in FSUIPC4 'Keys' options

2452117 KEYUP: VK=17, Waiting=0

2453178 KEYDOWN: VK=17, Waiting=0, Repeat=N, Shifts=2

2453178 .. Key not programmed -- passed on to FS

2453178 KEYDOWN: VK=121, Waiting=0, Repeat=N, Shifts=2

2453178 *** EVENT: Cntrl= 70205 (0x0001123d), Param= 1 (0x00000001) <70205>

2453178 FS Control Sent: Ctrl=70205, Param=1

2453178 .. This key is programmed in FSUIPC4 'Keys' options

2453178 KEYUP: VK=121, Waiting=0

2453178 *** EVENT: Cntrl= 70205 (0x0001123d), Param= 0 (0x00000000) <70205>

2453178 FS Control Sent: Ctrl=70205, Param=0

2453178 .. This key is programmed in FSUIPC4 'Keys' options

2453178 KEYUP: VK=17, Waiting=0

Yet it seems to me that it should work.

Otherwise by reprogramming the control KeyUp with unused, it does not work better.

Regards

Gerard

Link to comment
Share on other sites

I used the parameters 1 and 0 because this is what is written in the PMDG SDK :

Yes, but that example is for setting a switch. The 0 and 1 tell it whether to open or close the switch. You are merely entering characters in the FMC scratchpad. The parameter is (theoretically) of no use.

However, this part:

// Send another command only if there is no active command request

// and previous command has been processed by the NGX

if (Control.Event == 0)

strongly implies that the 737NGX code only accepts a new command if it is different in some way to the previous one. It evidently assumes otherwise that the command is in fact statically set. When you change the parameter 0-1-0 etc it is evidently making it believe the command is different, and then processing it as normal. Hence your repeats.

The log proves conclusively that FSUIPC is doing exactly what it should, so the only answer is to find a way to convince the NGX code that you should be allowed to send the same character twice or more when needed.

Otherwise by reprogramming the control KeyUp with unused, it does not work better.

Sorry, you need to explain more about that. What did you try, and what was the result?

Really this is now a matter for PMDG support. I don't know what their code is doing or why -- they must be able to advise. It could well be a bug which they should fix.

If the only way to to have a different parameter for each keypress, just to make it different from the previous one, then you could implement that by using a Lua plug-in. But please check with PMDG first as that may get complicated with so many keys to program.

Pete

Link to comment
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
×
×
  • 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.