Sign in to follow this  
aerostar

Mouse Event - Triggered by JOY Button

Recommended Posts

Posted (edited)

Hi, I'm trying to configure a ButtonBox button for the VS and FLC buttons on this aircraft.

It has about six functions triggered by the MouseClick on each of the VS, FLC buttons. I've tried but can't get them to work using LVARs.

Therefore I am trying to get the ButtonBox button to trigger as the Mouse Event does and execute the script as if the mouse button was clicked.

I've added in the Shaded Section in the script below, not having any real idea of what I'm doing...  can anyone advise if there is a way to do this properly or am I wasting my time.   Thanks

 

XML_Code_E50_P_AP.jpg

The Joystick name is what SPADnext lists it as...

Edited by aerostar

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

XML is reverse polish notation. That line should be:

	(M:Event) 'LeftSingle' scmp 0 ==
	(spad event) == or
	if{ rest of stuff to be done }
	

BTW if you use a {code}] prefix followed by a {/code} suffix (using square [ ] brackets!), then the code will be easier to read and copy/paste for replies. :biggrin:

Share this post


Link to post
Share on other sites
Posted (edited)

Hi Fr. Bill,  thanks for replying... 

I have tried this and many many other ideas over the past few days but can't seem to get it to work..  could it be that the script is inside a M:Event and only mouse will trigger it?   Thinking...  if I delete the mouse part of it and somehow make the script inside a Keyboard or Button Event would that work (if it's possible to make those as events)

 

P.S.  Was my first post , before the edited one above,  not shown because it had possible references in the LVARS to the aircraft maker ...  or something else,  just wondering

 

Edited by aerostar

Share this post


Link to post
Share on other sites

What you are trying to do is simply not possible.  XML will never see actual hardware input from the joystick button as the sim doesn't expose those.  The closest you could come is to write something that sees a custom event come in, assign said custom event to the button vial spad.  I don't know if XML can see a custom event happen or not.

Share this post


Link to post
Share on other sites

An alternate way?
- Use fsuipc to trap the button box buttons and send to one or more lua files
- In the lua(s) rewrite the animation code in lua to do the work.. (fsuipc/lua supports the read/write of L:vars) 

Share this post


Link to post
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
Sign in to follow this