Add PMDG 737NGX events to the FSX Events list

What features you would like to have in HIDmacros?
ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 01 Mar 2013, 12:54

Petr, thank you for the great tool!

I'd like to ask if you could add all the PMDG 737NGX events to the existing drop-down list of FSX events? They work exactly the same, just different range of numbers.
All events can be found in the SDK file provided with the aircraft:
<FSX main folder>\PMDG\PMDG 737 NGX\SDK\PMDG_NGX_SDK.h
Or on this website:
http://www.blueskies737.com/737ngx-control-codes/

Right now we need to know the event numbers to use them, for ex. to switch the A/T ARM:
HIDMacros.FSXEvent "#70012", 0

The only requirement (you can put it as a note in documentation) to use those events is to enable PMDG data broadcasting, that is add the following 2 lines to this file: <FSX main folder>\PMDG\PMDG 737 NGX\737NGX_Options.ini
[SDK]
EnableDataBroadcast=1

Thanks in advance,
Michal

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Add PMDG 737NGX events to the FSX Events list

Post by admin » 04 Mar 2013, 09:37

Hi Michal

Thanks for your investigation and tutorial-post, I belive PMDG users will like it :-).

Regarding events - I'll work on it. Currently events are hardcoded and I think HIDmacros is sending the name - exactly the value available in the list. After quick look I think for PMDG I'll have symbolic name from .h file to be displayed and the hex value to be sent. So I need to change it little bit and probably I'll move the list to some configuration file containing standard FSX events, PMDG and whatever different ones.
I'm currently working on MIDI input (as I found old unused midi keyboard at home :-) ) so I'll try to include this possibility into next beta.
Petr Medek
LUAmacros author

ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Re: Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 05 Mar 2013, 10:10

Petr,

Great to hear that, thanks. Of course I can help with beta testing.

Wow, the MIDI keyboard, I remember those from the early 90's :)

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Add PMDG 737NGX events to the FSX Events list

Post by admin » 07 Mar 2013, 00:48

Michal,

if you want to help me with beta testing, here's the chance.
Download night build exe from http://www.hidmacros.eu/HIDMacros.exe and replace it in your installation.
New behavior is:
if there's a file named FSXevents.lst in application directory it's used to feed the combo with FSX events. If there's no such file, current behavior with hardcoded standard values is used.
Each line in the file is for one option in combo box. You can even place event name directly, like for standard FSX events, e.g.:
DME_SELECT
Or if you want to have different event code and label in combo (which will be probably case for PMDG) use colon to separate code and caption, e.g.:
NAV1_RADIO_SWAP:Nav 1 radio swap
Find sample file with default FSX events at http://www.hidmacros.eu/FSXevents.lst
You can use it as starting point for your tests.

Hope my explanation is sufficient and these changes will work for you.

P.
Petr Medek
LUAmacros author

ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Re: Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 07 Mar 2013, 11:51

Děkuji Petr,

I'll give it a try over the weekend. If everything works well I will send you the .lst file with PMDG events included.

Michal

ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Re: Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 07 Mar 2013, 19:48

Ok, I tried to add the following, but none of them are working:
70010:PMDG_EVT_MCP_FD_SWITCH_L
#70010:PMDG_EVT_MCP_FD_SWITCH_L
"#70010":PMDG_EVT_MCP_FD_SWITCH_L
'#70010':PMDG_EVT_MCP_FD_SWITCH_L
\#70010:PMDG_EVT_MCP_FD_SWITCH_L
"\#70010":PMDG_EVT_MCP_FD_SWITCH_L

Am I missing something here? How do you execute an event in code? Just to remind, the working script is like this:
HIDMacros.FSXEvent "#70010", MOUSE_FLAG_LEFTSINGLE
with double quotes, maybe that's what is missing when you put the event value in the code?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Add PMDG 737NGX events to the FSX Events list

Post by admin » 08 Mar 2013, 08:30

Ok, thanks for test.
Not sure now, I'll check tonight.
Petr Medek
LUAmacros author

ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Re: Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 08 Mar 2013, 11:48

Maybe you could add an "if" when the line in .lst file starts with # you would treat it as a custom event and execute exactly as in my example above, and otherwise treat it like the built in FSX event?

admin
Site Admin
Posts: 735
Joined: 01 Nov 2010, 13:00
Location: Prague, Czech republic
Contact:

Re: Add PMDG 737NGX events to the FSX Events list

Post by admin » 10 Mar 2013, 21:17

Michal,

what is the exact problem you have? Not having the value in list, or the event doesn't work?
I don't have PMDG so can not do full test, but all seems to work...

I changed the FSXevents.lst file adding as first line:

Code: Select all

#70010:PMDG_EVT_MCP_FD_SWITCH_L
REPAIR_AND_REFUEL
DME_SELECT
...
Then I defined macro with this event (note there's alphabetical sort, so it will be somewhere in the middle) and when it's activated the event is sent to FSX according to debug log:

Code: Select all

Exe build number: 2.3.0.685
21:08:39.951 (2278238): Microsoft Flight Simulator X 10.0.61637.0
21:08:39.951 (2278238): SimConnect 10.0.61259.0
21:09:02.031 (2300312): Event #70010 registered as 3
21:09:02.031 (2300312): Event #70010 (3) sent to FSX with param 0.
For your tests you can set debugging for FSX area by launching hidmacros with parameter debug:FSX, so the complete command would be

Code: Select all

C:\Apps\hdm\HIDMacros.exe debug:FSX
If the event just doesn't work, you can compare debug output from predefined macro action (the combo) and script. Data sent to FSX should be the same so you should have the same messages in the log.

P.

PS: The debug output will appear in file debug.log when you quit hidmacros.
Petr Medek
LUAmacros author

ryhoo2
Posts: 21
Joined: 24 Feb 2013, 17:57
Location: Poland

Re: Add PMDG 737NGX events to the FSX Events list

Post by ryhoo2 » 11 Mar 2013, 10:02

Petr,

Thanks for checking this. I have the event on the list too, however it doesn't work. Thanks for the tip with the debug, I'll check it in the evening, but I think that the only difference will be #70010 vs. "#70010".

Michal

Post Reply