Jump to content
The simFlight Network Forums

using lua to toggle an hid's assignment?


cdub
 Share

Recommended Posts

I'd like to use lua to change the assignment of an hid/control in fsuipc.  Coming from a background in c++, so hopefully don't need everything spelled out.  If anyone knows how to refer to fsuipc existing assigned control and be able to suggest any similar examples, i think i would hit the ground crawling.

Specifically would like to be able to switch between OBI fast and slow with the same rotary switch to facilitate setting vor obi.  Even more specific: would like to be able to hold down one toggle switch and have it change the assignment of a rotary switch from OBI normal to OBI fast.  Seems like something that might exist already, but I wouldn't know where so would like to make my own.

thanks for looking!

Link to comment
Share on other sites

24 minutes ago, cdub said:

Even more specific: would like to be able to hold down one toggle switch and have it change the assignment of a rotary switch from OBI normal to OBI fast.  Seems like something that might exist already, but I wouldn't know where so would like to make my own.

You can do this using Compound Button Conditions. See the Advanced User Guide, P20.

Note that there is also a lua solution for fast/slow turning of rotaries that only have one button in each direction. See the example script Rotaries.lua, provided in the Example Lua plugins.zip (in your FSUIPC7 Documents folder). You should be able to use that, or adapt to your needs.

Link to comment
Share on other sites

Yes, much better and worked great.

 

my example for anyone who reads later with similar query:

 

1=CP(-C,28)C,26,C1026,0     -{vor1 obi dec fast}-
2=CP(-C,28)C,27,C1027,0     -{vor1 obi inc fast}-
3=CP(+C,28)C,26,C65662,0     -{VOR1_OBI_DEC}-
4=CP(+C,28)C,27,C65663,0     -{VOR1_OBI_INC}-

on device id C

where rotary counterclockwise is button 26, clockwise is button 27, and rotary push is button 28.

so you can adjust the obi fast initially and then fine tune by holding the rotary knob push button.

 

now i just need a john dowson for the rest of my life. eg:

me: my kid wont eat asparagus.

john dowson: easier to start with broccoli, instructions are in the user guide P20 ... You should be able to use that, or adapt to your needs.

 

 

 

Edited by cdub
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.