Dolphin, the GameCube and Wii emulator - Forums

Full Version: De-toggle key after activating another key?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
The title may be a bit vague, so I'm going to go into more detail:

I'm playing Mario Kart Wii. I want to use my Xbox One controller and I have a quirky need in order to get the most out of it. I need the left trigger of the emulated GC controller (BTW I have it set as Standard Controller and I am, as I said, using an Xbox One controller) to only be held from when I press `Shoulder L` on my controller, until I either press 1)`Shoulder L` again OR 2)I activate `Left Y+`/`Left Y-` with a trigger of 90%. Reason for this is that I forget whether `Shoulder L` is toggled or not, and I need something to make sure that it gets reset. It would also be handy since throwing an item would automatically unhold it. If I ignore my last requirement (activating Left Y+/- should stop Shoulder L from being held), the solution is very simple: toggle(`Shoulder L`). De-toggling it by activating other keys though...

I played around with the controls but I don't have any documentation whatsoever on any of the operators/functions. While I understand most of them, others can have quirky behaviour in some situations, which can help me achieve my goal (e.g. toggle(X) goes through a 2-state cycle: on-off, between which it cycles after each pressing of X, while toggle(toggle(X)) goes through a 4-state cycle: on-on-off-off, which is interesting but I don't understand because I don't have a documentation about the behaviour).

Is there a way for me to do this? Or a documentation for me to follow? I heard variables are possible with this, which sounds really promising.



Thanks!
EDIT: Cleaned my text so it's easier to read.
toggle() has a parameter for this. toggle(toggle_state_input, [clear_state_input])

The best information I could find is putting the function in with parenthesis and without anything else. You could also look at the source code and go to Source\Core\InputCommon\ControlReference\FunctionExpression.cpp

You should try this:
Code:
toggle(`Shoulder L`, (`Left Y+` > 0.9)|(`Left Y-` > 0.9))
(07-30-2020, 03:15 PM)Craftyawesome Wrote: [ -> ]toggle() has a parameter for this. toggle(toggle_state_input, [clear_state_input])

The best information I could find is putting the function in with parenthesis and without anything else. You could also look at the source code and go to Source\Core\InputCommon\ControlReference\FunctionExpression.cpp

You should try this:

Code:
toggle(`Shoulder L`, (`Left Y+` > 0.9)|(`Left Y-` > 0.9))
Thanks so much, that worked! I didn't know how to mix them all together. I assumed, wrongly, that clear_state_input was the default value of toggle (which by default would have beenĀ 0).
My controller configuration is finally complete!