simconnect key input

#1
Hello,

i need to receive a message from simconnect if i press TAB+1 in Prepar3d v4.
For that i tried this code as example i found with key A:

enum EVENT_ID : uint
{
EVENT_A
}
enum INPUT_ID : uint
{
INPUT_KEYS
}

simconnect.MapInputEventToClientEvent(INPUT_ID.INPUT_KEYS, "A", EVENT_ID.EVENT_A, (uint)1, (EVENT_ID)SimConnect.SIMCONNECT_UNUSED, (uint)1, false);

but i get a error number 1 , which say only ERROR.
So i really need help here what is wrong.

Since i am not a big C# guru, maybe i need a bit more help. sorry

I did a long search for an example, but did not found anything working in C#

Please help
Thanks Matthias
 
Top