Jump to content
The simFlight Network Forums

Use of 'Toggle' commands via FSUIPC


ub40

Recommended Posts

Hi,

I hope someone can help with this one.

I am building a cockpit panel with the use of a keyboard emulator. Some of the switches, like certain lights, are ok. These use an on and off command, but many lights, master battery, avionics etc, are only available as 'Toggle' commands, and when connecting a rocker switch and programming through fsuipc, the relative panel switch continuously operates on and off.

Is there a command i can use to cancel this action or enter into the 'action when released' section. I understand that a toggle command is a simple momentary make action, but is there any way i can make it an on and off command

Any help gratefully received

Cheers

Link to comment
Share on other sites

I am building a cockpit panel with the use of a keyboard emulator. Some of the switches, like certain lights, are ok. These use an on and off command, but many lights, master battery, avionics etc, are only available as 'Toggle' commands, and when connecting a rocker switch and programming through fsuipc, the relative panel switch continuously operates on and off.

Is there a command i can use to cancel this action or enter into the 'action when released' section. I understand that a toggle command is a simple momentary make action, but is there any way i can make it an on and off command

Not as straightforwardly, no. The easy thing to do is simply assign the toggle control to both the "press" and the "release" action of your switch. This works fine except that you need to synchronize the settings at the start -- i.e. your switches off or on when the FS ones are. Thereafter you should be okay.

There is another way and that is by using the FSUIPC offsets to turn things on and off. For lights they are all grouped in one offset (0D0C), with one bit for each. You'd use the "offset word setbits" to set specific bits in that offset, and "offset word clearbits" to clear them. See the Offsets list (a document in the FSUIPC SDK, or now included in your FSUIPC Documents folder if you've installed the current version of FSUIPC).

Regards

Pete

Link to comment
Share on other sites

Hi Pete,

Thanks for your suggestions. I tried allocating the same command to both 'operate and cancel' modes, but the continual flicking on and off continues.

I've taken a look at your other suggestion of using an offset, but without a lot more studying this one eludes me. I understand the offset value has to appear in the ini file, but as to yet i am unsure of the contents of the command to enter, so i shall persevere with this and try and grasp the concept.

Until then, i think i will just try and modify a switch to operate the toggle keys with a rocker.!!!!!!!!!!!

Thanks again..........................Tony

Link to comment
Share on other sites

Thanks for your suggestions. I tried allocating the same command to both 'operate and cancel' modes, but the continual flicking on and off continues.

Ah, sorry, I missed the point that it is contnuously switching. That can only be because you have the button press action set to repeat whilst held! NEVER use that option for a toggle switch, it is only intended for a momentary button, obviously.

I've taken a look at your other suggestion of using an offset, but without a lot more studying this one eludes me. I understand the offset value has to appear in the ini file, but as to yet i am unsure of the contents of the command to enter, so i shall persevere with this and try and grasp the concept.

It's absolutely NOT necessary to even look at the INI file!! You simply ASSIGN, in FSUIPC options, to the "Offset Word SetBits" or "Offset Word ClearBits" commands in the drop down list, then enter xD0C for the Offset part, which you will then immediately see, and the value for the switch in the Parameter field. For that value you only need to convert the Bit Number listed in the Offsets document to a decimal value -- 1 for bit 0, 2 for bit 1, 4 for bit 2 and so on (multiply by 2 each time -- for a guide on bits and bytes and numbers, please see the FAQ subforum).

Until then, i think i will just try and modify a switch to operate the toggle keys with a rocker.!!!!!!!!!!!

I don't really understand why you get defeated by something so easy? It is my English which isn't clear?

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.