Jump to content
The simFlight Network Forums
stevem737

One Script For All Joystick Buttons Question

Recommended Posts

Hello,

I've searched the documentation, forum, and web and I'm totally lost...

I'm writing Lua scripts to control the JustFlight Vulcan add-on.  If I've got a joystick or button box with, say 50 buttons, it seems I need to do one of the following:

  1. Write 50 different Lua scripts in the Modules folder, each assigned manually from the Buttons & Switches tab to each button (which makes for a ton of files to manage); or
  2. I've read about putting a single Lua script containing all the button code into the Modules folder and configuring the FSUIPC.INI file to automatically launch it.

It seems like (2), above, is the way to go.  But, my question is how to write that Lua script to assign a joystick/button combo to a given chunk of code.

Is there an example/guidance on writing Lua code to recognize the joystick/button combo, to assign the Lua code to?  Logically, something like "For Joystick 1, Button 12 pressed, FUEL_PUMP_7=1", "For Joystick 1, Button 13 pressed, FUEL_PUMP_8=1", and so on.

Overall, I'm trying to prevent having 50+ Lua scripts, and instead, have everything in one script for easier management.  Thank you for any help.

 

 

Share this post


Link to post
Share on other sites

It would be best for you to repost your question in Pete's main support forum:

https://forum.simflight.com/forum/30-fsuipc-support-pete-dowson-modules/

This is a sub-forum about using FSUIPC with .NET programming languages.

Pete might not see your post here and I don't know enough about LUA to answer your question here.

Paul

Share this post


Link to post
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...

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