PMDG 737 FMC/CDU Keyboard Control

How can be this controlled in that simulator? Can HIDmacros be used with this application?
Post Reply
Larry
Posts: 19
Joined: 28 Feb 2013, 06:45

PMDG 737 FMC/CDU Keyboard Control

Post by Larry » 12 Jan 2015, 07:37

Hello,
I am trying to setup a homemade 737NGX CDU panel wired to a USB keyboard "circuit board" (circuit board was removed from keyboard housing and wired directly to a custom made board to suit my purposes). When I program a letter using Hidmacros, lets say the letter "G", and I use the follow if string:

HIDMacros.FSXEvent "#70211", 1

This works...but will only enter one letter "G". If you try to enter more "G's" through keyboard presses, nothing happens. If I click on the letter G through the simulator FMC/CDU just one time, I can then enter another "G" through an Hidmacros keyboard assignment. Of course only one "G" can then be selected and the process starts over...etc.
If I use the following string:

HIDMacros.FSXEvent "#70211", 1
HIDMacros.FSXEvent "#70211", 0


I can select the "G" as many times as I want, BUT, it inserts 2 "G's" instead of one.

My question is, what script do I need so only one letter/symbol is entered per button push, and will only insert one letter at a time? I am not very good with programming but I can build/wire/solder almost anything.

Thanks in advance, and I can post pictures of the board if requested. It is a simple board using header jumper pins soldered to a prototype circuit board.

Thanks for any help on this matter. Larry

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

Re: PMDG 737 FMC/CDU Keyboard Control

Post by admin » 12 Jan 2015, 08:55

I don't have PMDG and don't know what you control with event 70211, but by the described behavior you may want to get "toggle" functionality for this even.
So maybe you need to send value 1 with the first key press and 0 with second one.
Then you even need to read the variable from simulator first and sent the other value or if you use just the macro for control (not e.g. mouse in virtual cockpit) then it's safe to use global variable in HidMacros to store current value and set the other one with macro (and update global variable).

Hmm, maybe too complicated description, sorry :-)
Petr Medek
LUAmacros author

Larry
Posts: 19
Joined: 28 Feb 2013, 06:45

Re: PMDG 737 FMC/CDU Keyboard Control

Post by Larry » 12 Jan 2015, 19:15

Thanks for your help. :)
Event 70211 is the event assigned to the letter G on the CDU/FMC panel. It is found on the PMDG 737 SDK. I used this an an example. There are no variables given through the SDK for the buttons, so I have to guess what works (always usually 0, 1 or 2 for PMDG variables/switches etc). Most other switches in SDK will give you the variable.

The buttons are simulated... "spring loaded"....you push and release just like a keyboard button. So I do not know why this is so complicated. Like I said before, I am not good at this script/programming, I am a mechanical/technical expert with great soldering/building skills and your programming explanation went right over my head. What I usually do is look for script someone has used that works, and I can adjust it for my purposes.

Like I said, this line: HIDMacros.FSXEvent "#70211", 1, will simulate a "PUSH AND HOLD " of the button. I cannot use key command again unless I actually click the button in the simulator.

This line (below) works without "locking down the button, but enters 2 letters at a time.

HIDMacros.FSXEvent "#70211", 1
HIDMacros.FSXEvent "#70211", 0

I just need some one to post some example script so I can try it. Sorry but I have no clue. There is no need for Hidmacros to "read" the current value/state of switch as they are always on a "popped up/open" state......spring loaded like a keyboard button. I'm thinking anyone who has experiense with a simple pushbutton can give me some type of example. THe SDK value (numbers from SDK are all available) Thanks, Larry :mrgreen:


JUST FOR EXAMPLE....
Here are SDK CDU VALUES:

// CDU
EVT_CDU_L_L1 70166
EVT_CDU_L_L2 70167
EVT_CDU_L_L3 70168
EVT_CDU_L_L4 70169
EVT_CDU_L_L5 70170
EVT_CDU_L_L6 70171
EVT_CDU_L_R1 70172
EVT_CDU_L_R2 70173
EVT_CDU_L_R3 70174
EVT_CDU_L_R4 70175
EVT_CDU_L_R5 70176
EVT_CDU_L_R6 70177
EVT_CDU_L_INIT_REF 70178
EVT_CDU_L_RTE 70179
EVT_CDU_L_CLB 70180
EVT_CDU_L_CRZ 70181
EVT_CDU_L_DES 70182
EVT_CDU_L_MENU 70183
EVT_CDU_L_LEGS 70184
EVT_CDU_L_DEP_ARR 70185
EVT_CDU_L_HOLD 70186
EVT_CDU_L_PROG 70187
EVT_CDU_L_EXEC 70188
EVT_CDU_L_N1_LIMIT 70189
EVT_CDU_L_FIX 70190
EVT_CDU_L_PREV_PAGE 70191
EVT_CDU_L_NEXT_PAGE 70192
EVT_CDU_L_1 70193
EVT_CDU_L_2 70194
EVT_CDU_L_3 70195
EVT_CDU_L_4 70196
EVT_CDU_L_5 70197
EVT_CDU_L_6 70198
EVT_CDU_L_7 70199
EVT_CDU_L_8 70200
EVT_CDU_L_9 70201
EVT_CDU_L_DOT 70202
EVT_CDU_L_0 70203
EVT_CDU_L_PLUS_MINUS 70204
EVT_CDU_L_A 70205
EVT_CDU_L_B 70206
EVT_CDU_L_C 70207
EVT_CDU_L_D 70208
EVT_CDU_L_E 70209
EVT_CDU_L_F 70210
EVT_CDU_L_G 70211
EVT_CDU_L_H 70212
EVT_CDU_L_I 70213
EVT_CDU_L_J 70214
EVT_CDU_L_K 70215
EVT_CDU_L_L 70216
EVT_CDU_L_M 70217
EVT_CDU_L_N 70218
EVT_CDU_L_O 70219
EVT_CDU_L_P 70220
EVT_CDU_L_Q 70221
EVT_CDU_L_R 70222
EVT_CDU_L_S 70223
EVT_CDU_L_T 70224
EVT_CDU_L_U 70225
EVT_CDU_L_V 70226
EVT_CDU_L_W 70227
EVT_CDU_L_X 70228
EVT_CDU_L_Y 70229
EVT_CDU_L_Z 70230
EVT_CDU_L_SPACE 70231
EVT_CDU_L_DEL 70232
EVT_CDU_L_SLASH 70233
EVT_CDU_L_CLR 70234
EVT_CDU_L_BRITENESS 70237
EVT_CDU_R_L1 70238
EVT_CDU_R_L2 70239
EVT_CDU_R_L3 70240
EVT_CDU_R_L4 70241
EVT_CDU_R_L5 70242
EVT_CDU_R_L6 70243
EVT_CDU_R_R1 70244
EVT_CDU_R_R2 70245
EVT_CDU_R_R3 70246
EVT_CDU_R_R4 70247
EVT_CDU_R_R5 70248
EVT_CDU_R_R6 70249
EVT_CDU_R_INIT_REF 70250
EVT_CDU_R_RTE 70251
EVT_CDU_R_CLB 70252
EVT_CDU_R_CRZ 70253
EVT_CDU_R_DES 70254
EVT_CDU_R_MENU 70255
EVT_CDU_R_LEGS 70256
EVT_CDU_R_DEP_ARR 70257
EVT_CDU_R_HOLD 70258
EVT_CDU_R_PROG 70259
EVT_CDU_R_EXEC 70260
EVT_CDU_R_N1_LIMIT 70261
EVT_CDU_R_FIX 70262
EVT_CDU_R_PREV_PAGE 70263
EVT_CDU_R_NEXT_PAGE 70264
EVT_CDU_R_1 70265
EVT_CDU_R_2 70266
EVT_CDU_R_3 70267
EVT_CDU_R_4 70268
EVT_CDU_R_5 70269
EVT_CDU_R_6 70270
EVT_CDU_R_7 70271
EVT_CDU_R_8 70272
EVT_CDU_R_9 70273
EVT_CDU_R_DOT 70274
EVT_CDU_R_0 70275
EVT_CDU_R_PLUS_MINUS 70276
EVT_CDU_R_A 70277
EVT_CDU_R_B 70278
EVT_CDU_R_C 70279
EVT_CDU_R_D 70280
EVT_CDU_R_E 70281
EVT_CDU_R_F 70282
EVT_CDU_R_G 70283
EVT_CDU_R_H 70284
EVT_CDU_R_I 70285
EVT_CDU_R_J 70286
EVT_CDU_R_K 70287
EVT_CDU_R_L 70288
EVT_CDU_R_M 70289
EVT_CDU_R_N 70290
EVT_CDU_R_O 70291
EVT_CDU_R_P 70292
EVT_CDU_R_Q 70293
EVT_CDU_R_R 70294
EVT_CDU_R_S 70295
EVT_CDU_R_T 70296
EVT_CDU_R_U 70297
EVT_CDU_R_V 70298
EVT_CDU_R_W 70299
EVT_CDU_R_X 70300
EVT_CDU_R_Y 70301
EVT_CDU_R_Z 70302
EVT_CDU_R_SPACE 70303
EVT_CDU_R_DEL 70304
EVT_CDU_R_SLASH 70305
EVT_CDU_R_CLR 70306
EVT_CDU_R_BRITENESS 70309

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

Re: PMDG 737 FMC/CDU Keyboard Control

Post by admin » 13 Jan 2015, 08:53

Seems to be more related to finding a way how to communicate with SDK.
Maybe someone with the plane and interfacing experience can advice...
Petr Medek
LUAmacros author

Larry
Posts: 19
Joined: 28 Feb 2013, 06:45

Re: PMDG 737 FMC/CDU Keyboard Control

Post by Larry » 13 Jan 2015, 19:03

I will post my findings here if I get a solution.

Larry
Posts: 19
Joined: 28 Feb 2013, 06:45

Re: PMDG 737 FMC/CDU Keyboard Control

Post by Larry » 19 Jan 2015, 08:50

Hi,
I was able to get FMC keyboard inputs to work without a double input" by inserting a NEGATIVE sign in front of the parameter. Like this:

HIDMacros.FSXEvent "#70125", -1

Example above is for the number "3". Hope this helps others who have the same issue down the road. Larry :P

Post Reply