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