knapp

cfml help

10 posts in this topic

I want to modify my cfml files so I can put my WEP control on a toggle switch on my joystick. I'm trying to program it so WEP is on while the switch is on and turns off when the switch is off. I've spent a few hours trying to modify the code with no success. Searches on the forum came up with nada and the wiki didn't have the code I need. Does anyone know how to do this? Any help will be greatly appreciated. 

Share this post


Link to post
Share on other sites

does your toggle switch send a Button ON/OFF signal, or does it send a BUTTON 1 / BUTTON 2 signal?

 

also default WEP in air cfml is

    <control>
        <function>toggle wep</function>
        <key>f8</key>
   </control>

 

Need to know what game sees your toggle as when you flip it to the WEP position
This may work, if your toggle sends a button input both ways, just have to see what it counts as when it is pushed the way you want it

<control>
        <function>toggle wep</function>
            <keyabsolute value="100" onrelease="0" index="10">      
                  <key>YOUR TOGGLE KEY ID</key>
           </keyabsolute>
</control>

Edited by Merlin51

Share this post


Link to post
Share on other sites

Hi Merlin, 

Thanks for the reply. I believe the game sees the switch as being always pressed. At least in the joystick viewer if it’s pushed into position it shows as being held down. So, I think it sends a constant signal. It’s an old HOTAS cougar, in case you’re familiar, and I want to map it to the locking side of the air break button.

 I tried some “keyabsolute” code similar to what you suggested above. Maybe I had a typo in mine, I’ll try it again. (Tried it , no success)

Edited by knapp
Update

Share this post


Link to post
Share on other sites

1st thing is, map that toggle switch to something, anything
make sure it does not send a different button press depending on direction, if it does, note each button it refers to.
and which button pertains to the direction you want to go.

Share this post


Link to post
Share on other sites

The switch has three positions, the center position is the off position. The two other positions are seen as a button, when in those positions. The game only recognizes the two outside positions and sees them as being held down. 

To test the button, I mapped it to infantry “move forward” and this is the behavior I observed. In the keymapper, after clicking on the mapping box, the when it is moved into the desired position, from center nothing happens, until moving it out of position, when it recognizes it and maps. In game as an infantry, when the switch is activated the infantry moves forward continuously, until the switch is moved back to the center position and the infantry stops. 

I hope this answers your question. Thanks again for your help. 

Share this post


Link to post
Share on other sites

wsad may not be the best to test as they are special cased I think. you are wanting a on/off toggle. I would map each throw to something like the rpm up/down and see if it writes to the cfml and how it writes it.

Share this post


Link to post
Share on other sites

To map it you have to move it into position then out of position. This represents one button push, because when in position the game sees it as a button held down. When mapped to adjust prop up the game codes the button like this.

<control function="Adjust prop up">
        <joybutton stick="1">28</joybutton>

</control>

I can map the switch position to WEP with the key mapper, and it looks just like it does above, but when done in this manner it becomes necessary to cycle the switch into position and out of position to turn WEP on and cycle it again to turn WEP off. What I want it to do is to turn WEP on when moved into position and turn WEP off when moved out of position. In that way I can tell by touching the switch if WEP is on or off without having to cycle it and see what the chat bar says.    
 

Share this post


Link to post
Share on other sites

Not sure that will be doable because the game infact does see it as a button held down. Maybe Merlin can come up with a better answer.

Share this post


Link to post
Share on other sites
10 hours ago, knapp said:

The switch has three positions, the center position is the off position. The two other positions are seen as a button, when in those positions. The game only recognizes the two outside positions and sees them as being held down. 

To test the button, I mapped it to infantry “move forward” and this is the behavior I observed. In the keymapper, after clicking on the mapping box, the when it is moved into the desired position, from center nothing happens, until moving it out of position, when it recognizes it and maps. In game as an infantry, when the switch is activated the infantry moves forward continuously, until the switch is moved back to the center position and the infantry stops. 

I hope this answers your question. Thanks again for your help. 

Yes game sees when you release the key as far as mapping it
so to map toggle WEP turn the switch on and off, to WEP position and back, and it should toggle WEP on

it wont turn it off when released as WEP is a toggle

But you might get WEP to untoggle by using a key absolute, and an on release
not sure though since WEP was set up as a hard coded toggle.
If you use the switch for nothing else, mapping both sides to toggle WEP will flip it on and off.
Then you just have to make sure to flip it past center

Does the cougar have programming software that would let you program that key to send a keyboard sequence when switched on, and a 2nd sequence when released?
 

*EDIT
No, i tried the onrelease, but all it does is induce an odd delay into the toggle
because it is hard coded as a toggle it only knows to look for successive key presses
What you could do is map WEP to both buttons, and flipping the switch full one way would turn it on, and full the other would turn it off.
I tried this on the 3 way switch on my stick, set WEP to be both top and bottom position with middle position doing nothing
and it worked.

We would have to code WEP to have a toggle / continuous switchable input
When the game inputs were done, i do not think many sticks offered switches with an A off B input

If it was not probably a pain, i would say swap the SPDT constant switch it has now with a SPDT momentary
switch, the kind you push it up or down and it returns to center on release.
 


 

Edited by Merlin51

Share this post


Link to post
Share on other sites
23 hours ago, Merlin51 said:

I tried this on the 3 way switch on my stick, set WEP to be both top and bottom position with middle position doing nothing
and it worked.

This may be the route I go. The Cougar does come with some very powerful software for programming the button configurations to do exactly what I want, but since it's so old it doesn't get along with windows 10 very well and opens up a whole different set of issues to wrestle with. 

Thanks for all the help! 

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.