Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Pete,

Many thanks for your help last week with the POV switches, I can access them individually now without any problem.

Following this, I am looking for a way to emulate a "Repeat" function for these POV buttons to be defined using a Lua file setup. I came across the following method in one of your previous posts

while ipc.testbutton(joy, btn) ~= 0 do

ipc.control(65674)

ipc.sleep(50) -- 50 = 20 repeats per second. Adjust to taste!

end

but I don't think that the ipc.testbutton(joy, btn) function works with the POV switches? Can you suggest an alternative way?

Best regards

Seanmick.

Posted

Many thanks for your help last week with the POV switches, I can access them individually now without any problem.

Following this, I am looking for a way to emulate a "Repeat" function for these POV buttons to be defined using a Lua file setup.

Sorry, I'm lost, again. Are you assigning them as buttons or axes? What is the context.

You'll have to forgive me if I should remember this stuff, but my day is full of so many little different things that I need to be reminded of context, especially after a gap and in a new thread.

... I don't think that the ipc.testbutton(joy, btn) function works with the POV switches?

No, it cannot because POV positions cannot be read, unlike button states.

Can you suggest an alternative way?

If you are using Events to register when a POV is operated then you could then start a separate Lua for that POV value (or call a generic one with the POV number as parameter) using ipc.macro. That Lua would perform the loop as in the example you found, until it is signalled to exit. That signal would be by your POV event handler detecting a DIFFERENT POV or the "up"event for the original. One way of signalling would be by using a Global variable set in the handler (ipc.set) and tested in the slave POV loop executing Lua (ipc.get).

Regards

Pete

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.