Jump to content
The simFlight Network Forums

Button Programing


Recommended Posts

Pete

Is it possible to have toggle functions assigned to one button? I have the GF-P8 push button module and so as to not eat up all my assigned buttons I would like to have two functions assigned to one button so that push #1 activates some function such as opening the world map and push #2 closes the map window and returns to flight. I guess the easiest way would be to use toggle switches but I have several PB8 modules.

Thanks

Alan

Link to comment
Share on other sites

Is it possible to have toggle functions assigned to one button? I have the GF-P8 push button module and so as to not eat up all my assigned buttons I would like to have two functions assigned to one button so that push #1 activates some function such as opening the world map and push #2 closes the map window and returns to flight.

Yes. That is exactly what button flags are for. You would have to edit the INI file though, because you need to have three actions programmed: one to toggle a flag and then the two ones you want each conditional on the flag -- one when set, the other when not set.

Check the Advanced User's guide. Search for the paragraph which starts "The conditions can be made to apply not to the current state of a button, but to the state of a ‘flag’ that is set and cleared by a button (or even a keypress)."

Regards

Pete

Link to comment
Share on other sites

Yes. That is exactly what button flags are for. You would have to edit the INI file though, because you need to have three actions programmed: one to toggle a flag and then the two ones you want each conditional on the flag -- one when set, the other when not set.

Check the Advanced User's guide. Search for the paragraph which starts "The conditions can be made to apply not to the current state of a button, but to the state of a ‘flag’ that is set and cleared by a button (or even a keypress)."

Regards

Pete

Thanks Pete. I did have a cursory look at the advanced user guide but it scared the heck out of me. I will read up on the section you mentioned.

Alan

Link to comment
Share on other sites

Pete

I read the section you referred to and noted this paragraph:

FSUIPC leaves no delays at all between actions when the ALT key has been used. Otherwise, as soon as it allows the processing of the keys to begin, the ALT key combination will bring up the menu item and (in this case) dialogue, and FSUIPC will not be running and will therefore not be able to provide the key releases. Horrible mix-ups may then ensue!

So, in the example I gave above (to open the World Map) the button routine would not work because the first push of the button brings up the FSX Menu (via key strokes), and a second push of the button would not return to flight as FSUIPC would not now be running. Am I understanding this correctly?

Thanks

Alan

Link to comment
Share on other sites

So, in the example I gave above (to open the World Map) the button routine would not work because the first push of the button brings up the FSX Menu (via key strokes), and a second push of the button would not return to flight as FSUIPC would not now be running. Am I understanding this correctly?

There's no way a simple button programmed in FSUIPC can send keystrokes to any dialogues in FS, because the main parts of FSUIPC aren't actually running then, unless you enter its own dialogue -- though that is still in "dialogue mode". All those menus are "Modal", which means all else stops whilst they are active. This is normal Windows dialogue behaviour.

Sometimes you can get a selection made by putting the keystrokes in the Windows keyboard buffer first, like for instance ALT O E D might get to the display Settings. But nothing thereafter.

You can do it with Lua plug-ins because they run independently, in their own threads. I think there's an example in the Lua Plug-Ins package supplied with FSUIPC which does this to enter fuel quantities into the fuel menu.

When you talked about "map" I was thinking "top down view", which is not the same of course. Sorry.

Regards

Pete

Link to comment
Share on other sites

There's no way a simple button programmed in FSUIPC can send keystrokes to any dialogues in FS, because the main parts of FSUIPC aren't actually running then, unless you enter its own dialogue -- though that is still in "dialogue mode". All those menus are "Modal", which means all else stops whilst they are active. This is normal Windows dialogue behaviour.

Sometimes you can get a selection made by putting the keystrokes in the Windows keyboard buffer first, like for instance ALT O E D might get to the display Settings. But nothing thereafter.

You can do it with Lua plug-ins because they run independently, in their own threads. I think there's an example in the Lua Plug-Ins package supplied with FSUIPC which does this to enter fuel quantities into the fuel menu.

When you talked about "map" I was thinking "top down view", which is not the same of course. Sorry.

Regards

Pete

Pete

That's what I thought after reading the advanced user guide. I saw in another post where you mentioned a LUA plugin called tripleuse.lua which seems to offer similar button programing (although not for the example I gave). Where do I find that file and how do I load a LUA plug in?

Thanks

Alan

Link to comment
Share on other sites

That's what I thought after reading the advanced user guide. I saw in another post where you mentioned a LUA plugin called tripleuse.lua which seems to offer similar button programing (although not for the example I gave). Where do I find that file and how do I load a LUA plug in?

All of the documentation and examples areinstalled in your FSUIPC Documents folder, as clearly stated in the Installation and Registration Guide.

Pete

Link to comment
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
×
×
  • 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.