Jump to content
The simFlight Network Forums

Recommended Posts

Posted

I've looked at the Lua examples and I can build and run the C++ example in Visual Studio.  So I know how to read/write the offsets.  In Lua, there are events that can be used to read input from joystick buttons.  What's the equivalent in C++?

I've searched and really can't find anything.

Thanks.

Posted

I guess I should add I'm using FSX with a registered version of FSUIPC 4.973.  I just want my C++ program to know when a joystick button is presses.

Posted
4 hours ago, Tom68 said:

I've searched and really can't find anything.

Then you didn't find offset 03C0!

Note that, as it says, you need to actually have the relevant joysticks actually scanned by FSUIPC, which means at least something assigned. But then the same applies in the Lua library facilities.

BTW the FSUIPC you are using is out of date. You should update.

Pete

 

Posted (edited)

OK, with 60 pages of numbers, I did miss that one.  Thanks.

Part of my question was also that Lua seems to have a library call that allows attaching a callback function to provide notification if a button changes. (I think)  For C/C++, with just access to an offset, it must be polled to detect when a button changes.  True?

Also, I just downloaded & registered FSUIPC in the last week or so.  I misspoke I actually have 4.974.  Is that the latest? 

Awesome program, by the way!

Edited by Tom68
Posted
Quote

 For C/C++, with just access to an offset, it must be polled to detect when a button changes.  True?

Yes! You could, of course, write a wrapper around the provided functions to implement a callback mechanism if required...

4.974 is the latest supported version, however there is a version 4.974b which contains an improved Lua ext library (see the 'Updated Modules' support page:

).

Cheers,

John

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.