Von Rondstadd Posted March 19, 2012 Report Share Posted March 19, 2012 Hi Pete, I have the PMDG 737 NGX. I want to use an lever from my Saitek Trottle quadrant for my gear !! It has to have three positions - gear down - gear up - and gear locked (in the middle). Is this possible and can you point me in the right direction how to do this?? Kind regards Robert Link to comment Share on other sites More sharing options...
Pete Dowson Posted March 19, 2012 Report Share Posted March 19, 2012 It has to have three positions - gear down - gear up - and gear locked (in the middle). Is this possible and can you point me in the right direction how to do this?? FS and therefore FSUIPC only supports Gear Up and Gear down. There's an example of exactly how to do that with a lever in the Axis assignments section of the User Guide. I believe there are special control numbers assigned in the PMDG NGX to get the three positions instead of two. These are documented in the PMDG NGX SDK which was installed for you with their recent update. Let me see ... yes, there are these: #define EVT_GEAR_LEVER (THIRD_PARTY_EVENT_ID_MIN + 455) #define EVT_GEAR_LEVER_OFF (THIRD_PARTY_EVENT_ID_MIN + 4551) #define EVT_GEAR_LEVER_UNLOCK (THIRD_PARTY_EVENT_ID_MIN + 4552) The "THIRD_PARTY_EVENT_ID_MIN" value is defined as #define THIRD_PARTY_EVENT_ID_MIN 0x00011000 // equals to 69632 which means their "OFF" control is 69632 + 4551 = 74183. You can send such controls via the Lua "ipc.control" function, so you'd need to make a little plug in and assign to that in the axis assignments, right-hand side -- as per the example for Gear Levers in the User Guide. An alternative to Lua plug-ins you might find mouse macros work on the gear lever. Judging from another post recently, I think they did on the FS9 PMDG 747. Examples of both techniques are found in the User Contributions subforum. Regards Pete Link to comment Share on other sites More sharing options...
Von Rondstadd Posted March 19, 2012 Author Report Share Posted March 19, 2012 Thank you Pete, I shall try that! Robert Link to comment Share on other sites More sharing options...
paulnd Posted March 19, 2012 Report Share Posted March 19, 2012 I've created a macro file (.mcro) with the following contents [macros]1=NGX_GEAR_up1.1=C70087, -21474836482=NGX_GEAR_off2.1=C74184, 5368709122.2=C74184, 1310723=NGX_GEAR_down3.1=C70087, 536870912[/CODE]You can then assign an axis range to each of these in FSUIPCI copied the values from the Linda lua files which has been an excellent resource.regardsPaul Link to comment Share on other sites More sharing options...
Pete Dowson Posted March 19, 2012 Report Share Posted March 19, 2012 I've created a macro file (.mcro) with the following contents [macros]1=NGX_GEAR_up1.1=C70087, -21474836482=NGX_GEAR_off2.1=C74184, 5368709122.2=C74184, 1310723=NGX_GEAR_down3.1=C70087, 536870912[/CODE]Interesting. The NGX SDK lists C74184 as "[color=#0000ff]EVT_GEAR_LEVER_UNLOCK"[/color]. Maybe that's why you need to send two of them with different parameters?Might be interesting to try just a single [b][color=#0000ff]C74183[/color][/b] for the "gear off" position.The parameter values are a little difficult to understand written in decimal too. If I use hexadecimal instead they don't look so bad:[b][macros]1=NGX_GEAR_up1.1=C70087, x800000002=NGX_GEAR_off2.1=C74184, x200000002.2=C74184, x000200003=NGX_GEAR_down3.1=C70087, x20000000[/b]According to the SDK, those single-bit values correspond to mouse actions, so:[color=#0000ff]#define MOUSE_FLAG_RIGHTSINGLE 0x80000000#define MOUSE_FLAG_LEFTSINGLE 0x20000000#define MOUSE_FLAG_DOWN_REPEAT 0x00200000[/color]There's not exactly a lot of explanation given in the SDK for the use of these mouse flags.RegardsPete Link to comment Share on other sites More sharing options...
paulnd Posted March 19, 2012 Report Share Posted March 19, 2012 thanks Pete, These are pre-SDK, found by logging and trial and error by the Linda team. Now that the SDK is available I'm sure quite a lot of tidying up can be done. I agree, hex values are much better. Paul Link to comment Share on other sites More sharing options...
Von Rondstadd Posted March 20, 2012 Author Report Share Posted March 20, 2012 Thank you all, I never worked with macros and hope I will get it to work! Kind regards Robert Link to comment Share on other sites More sharing options...
johanknol Posted March 21, 2012 Report Share Posted March 21, 2012 I had the same problem, and was a little bit confused by the values from MAIN_GearLever variable // 0: UP 1: OFF 2: DOWN the reply from a pmdg support ticket was: "He is right that the MAIN_GearLever variable has 3 possible values, 0=up, 1=off, 2=down.. This variable is converted from the actual gear lever animation step, which has much more intermediate positions. When he tries to set gear lever to a "direct" position like 0..1..2, nothing useful happens because this is interpreted as an animation step, not "up - off - down". He should try using mouse click simulation instead, i.e. pass MOUSE_FLAG_LEFTSINGLE or MOUSE_FLAG_RIGHTSINGLE instead of 0, 1, 2. This is described in the SDK docs. Send EVT_GEAR_LEVER with a left- or right-click parameter to move lever to UP or DOWN, and send EVT_GEAR_LEVER_OFF with a left-click parameter to move it to OFF." Works like a charm. HTH, Johan Link to comment Share on other sites More sharing options...
Von Rondstadd Posted March 22, 2012 Author Report Share Posted March 22, 2012 Thank you for the info Johan ! Got the mcro file from Paul and it is working just fine now. Very happy with it! Robert Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now