Jump to content
The simFlight Network Forums

Why no event for joystick button release


michel78320

Recommended Posts

Hi,

I am a registered user of FSUIPC7, with which I have been able to make lots of things for years.
I thank the authors a lot for this excellent software.

Today, I have got a small difficulty :

I want to use the "ENG1" button of my Airbus Throttle TCA (from Thrustmaster).
I wrote a Lua script with
   event.button ("H" , 2 , "my function") .

When I push the button, the event accesses correctly to "My Function" .
But when I release the button, there is no managed event.
Nothing happens (checked in the log of the console)

I also tried "event.button ("H" , 2 , downup,  "my function") : again no reaction on release.

Now, I tried to use Assignments + Buttons (in the menu) , with assigning one lua for Button-press and a second lua for Button-release.
It works perfectly well. 

Do you have an idea of why it works with KeyPress and not with event.button ?
Thank you in advance.

Link to comment
Share on other sites

12 hours ago, michel78320 said:

I also tried "event.button ("H" , 2 , downup,  "my function") : again no reaction on release.

To receive button presses and release, the format is:
    event.button ("H" , 2 , 3,  "my function")

The downup is a parameter and should be one of the following values (as described in the documentation):

Quote
Except for the button “255” case, the optional “downup” parameter specifies the change to be detected:

Omitted when pressed
1 when pressed
2 when released
3 when pressed or released (see Note * below

John

Link to comment
Share on other sites

Thank you for this very clear answer.

Indeed, I misinterpreted the documentation. Sorry !
Your example is very clear. Thank you.

FSUIPC is a wonderful program, which makes it possible to do what MSFS does not know how to do ...
I use Hvars and Lvars to interface all my hardware modules (Open Cockpit, VRinsight and CP-Flight) under MSFS.
That's wonderful, and your support is at the top.

 

 

Link to comment
Share on other sites

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.