WhiteMagic / JoystickGremlin

A tool for configuring and managing joystick devices.
http://whitemagic.github.io/JoystickGremlin/
GNU General Public License v3.0
306 stars 45 forks source link

Macro condition state isn't saved #538

Closed Ragntard closed 2 weeks ago

Ragntard commented 2 weeks ago

If I create a simple action with the condition "activate if vJoy 1 Button 1 is released" it automatically changes back to "pressed" instead of released whenever I leave that window. In the windows game controllers view, everything works as if the "pressed" option is set instead of "released" even if I don't leave the view.

I've tested around with multiple buttons and settings with the same results.

image (This is what I'm trying to set, but it reverts to "Pressed" whenever I leave the window and return.)

Also, if I save everything as an XML file, the file shows the correct state but it still doesn't look right in the GUI or acts as intended when testing the function.

                       <macro>
                            <properties/>
                            <actions>
                                <vjoy input-id="3" input-type="button" value="True" vjoy-id="1"/>
                            </actions>
                            <activation-condition rule="all">
                                <condition comparison="released" condition-type="vjoy" id="1" input="button" vjoy-id="1"/>
                            </activation-condition>
                        </macro>

Here I've set up two macros: image

When I leave this window and return to it they are both "Pressed" image

I'm on a new install of Joystick Gremlin and it's my first time using it.

WhiteMagic commented 2 weeks ago

This is a known bug (#361) that can be somewhat worked around.

Ragntard commented 2 weeks ago

I also managed to display the right states in UI using the debug version. Then the states display correct (and saves) but the actual macros don't behave as expected. Specifically the release command won't activate even when it displays as such in the UI. But this might be the same issue, I will test some of the workarounds you posted and see if it helps. Thank you so much!

WhiteMagic commented 2 weeks ago

If it's something about the macros themselves unrelated to the UI resetting the condition then feel free to update and reopen this. The whole macro UI will be redone so the bug if there is one might be squashed in that but good to know to look out for it if there is something. There is also some corner cases with Macros triggering with complicated conditions or containers.