Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello everyone. I'm trying to configure my dual-action trigger in my Gladiator NXT for two steps of braking: the first step would be half braking (done by a LUA I wrote) and the last step would be done by simply mapping the button to the period key (the key used in FS9-P3D for brakes).

In my VKB (joystick 0), the first trigger step is Button 0, and the second step is Button 1. However, there's no way to press Button 1 without pressing Button 0. I'd only have three states: No button pressed, Button 0 pressed, and Button 0+Button 1 pressed.

Trying each control separately, this is what I do:

32=P0,0,CL5:S,1     -{LuaSet FS_ABS (Flag 1)}-
33=U0,0,CL5:S,2     -{LuaSet FS_ABS (Flag 2)}-

And as expected, it works with Button 0. Setting nothing to Button 0 and setting these two mappings to Button 1 also work as intended. If I try the full brake, this is what I need to do.

32=R0,0,K190,8     -{Key press: .>key}-

And it works correctly. If I want to compound both buttons, this is what I enter into the ini file:

32=CP(-0,1)0,0,CL5:S,1     -{LuaSet FS_ABS (Flag 1)}-
33=CU(-0,1)0,0,CL5:S,2     -{LuaSet FS_ABS (Flag 2)}-
34=CR(+0,1)0,0,K190,8     -{Key press: .>key}-

Button 0 works correctly (brakes are half applied, as intended). However, if I press the trigger fully (i.e., while Button 0 is pressed, I press Button 1), nothing happens, as if I never pressed Button 1. I mean, the condition set in assignment #32 is still applying (until I release Button 0). I'd have expected that the last line (assignment #34) would have applied, and I'd have full brakes. Is it there something I forgot to do?

 

 

Posted
On 12/17/2024 at 2:35 AM, Luis Hernández said:

If I want to compound both buttons, this is what I enter into the ini file:

32=CP(-0,1)0,0,CL5:S,1     -{LuaSet FS_ABS (Flag 1)}-
33=CU(-0,1)0,0,CL5:S,2     -{LuaSet FS_ABS (Flag 2)}-
34=CR(+0,1)0,0,K190,8     -{Key press: .>key}-

Button 0 works correctly (brakes are half applied, as intended). However, if I press the trigger fully (i.e., while Button 0 is pressed, I press Button 1), nothing happens, as if I never pressed Button 1. I mean, the condition set in assignment #32 is still applying (until I release Button 0). I'd have expected that the last line (assignment #34) would have applied, and I'd have full brakes. Is it there something I forgot to do?

You should use FSUIPC's logging facilities to work out what is happening. Set logging for Buttons & keys, open the logging console and see what is logged when you press the buttons - this should tell you what is happening.

But if button 0 is already pressed when you press button 1, line 34 will NOT be triggered as that assignment is on button 0. Assignments are only triggered when the main/assigned button is pressed/released, not when the compound condition is changed. So, assignment 34 should be on button 1 with the compound condition on button 0 being pressed, i.e.
    34=CR(+0,0)0,1,K190,8     -{Key press: .>key}-

  • Thanks 1
Posted

Thanks, John. Inverting priorities (as you said) did the trick. Since I had to add the behavior for switching from half to full brake and back, this is what I got now:

32=CP(-0,1)0,0,CL5:S,1     -{LuaSet FS_ABS (Flag 1)}-
33=CU(-0,1)0,0,CL5:S,2     -{LuaSet FS_ABS (Flag 2)}-
34=CP(+0,0)0,1,CL5:S,2     -{LuaSet FS_ABS (Flag 2)}-
35=CR(+0,0)0,1,K190,8     -{Key press: .>key}-
36=CU(+0,0)0,1,CL5:S,1     -{LuaSet FS_ABS (Flag 1)}-

This works beautifully for anything between FS9 and P3Dv5. For MSFS2020, the period key works a bit different, so I decided to use a different LUA. But regarding this thread, the same principles apply. So I say again: thank you very much!

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.