WhiteMagic / JoystickGremlin

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

Feature suggestion: Toggle a macro with different Buttons ("functions"-tab) #328

Closed BenBlake79 closed 1 month ago

BenBlake79 commented 4 years ago

Hi,

I want to use a 3-position-switch (fwd and bwd positions are different buttons, the middle position is nothing - TM Warthog) to switch between 3 macros which are repeated wenn activated. Fwd and bwd are simple, the macro is in hold mode. But for the middle macro I need a way to: 1st: start it activated if Switch in middle position 2nd: toggle it whenever i switch to and from fwd and bwd. (refer to the same macro with different buttons)

Is there a way to do this without external Software?

The only solution I found is mapping fwd, bwd and a 3rd button to a second vjoy in UCR and then use this button in Joystick Gremlin to trigger the macro...

Thanks ;)

Ben

BenBlake79 commented 4 years ago

The solution with UCR/UJR seemed to work but then it stopped mapping the Button from one vjoy device to annother. Tried another way: Used a Key to be toggled which now has a macro in hold mode. To start or stop the macro for the middle position I tried an additional key in Smart toggle mode to toggle the "macro key" but as this generates a macro on it's own (as you described earlier) it does not refer to the same key either. I now use two macros with press/release the key and added the conditions "when key is released/pressed" and now it seems to work...

I think, an additional "functions"-tab would be nice where you can do what I know did with the key as a detour. Then you could refer to this function from different buttons...

Best regards Ben

WhiteMagic commented 4 years ago

The real solution to this is a user plugin, as Gremlin is not designed to have multiple distinct physical inputs interact with each other. If macros repeat types interacted a bit more gracefully with complicated conditions then that might also be a solution though from a quick test these hold repeat modes don't play well with action release conditions.

The functions tab you're describing is really what user plugins are there for. Custom, not commonly used functions that are easier done with code logic than being cobbled together with conditions etc. One thing that is missing from the user plugins is to either trigger the execution of existing actions and/or recoding macros/key strokes. The first aspect is impossible with how the current version of Gremlin is designed though the next version would be capable of supporting this on the tech side. The macro bit is trickier as adding an entire macro "variable" is not something I want to do, however, simple key combination recording is a more sensible and useful addition.

BenBlake79 commented 4 years ago

What I thought about was a virtual "device" where macros, buttons or keys could be assigned to a named key and then a "bind to function" would do the trick. The same I did with the keyboard detour - the issue here ist that the number of keys that wouldn't mess around with something is limited. If every key has to be assigned explicitly in the game there's no problem though I was just wondering about keys that do something without beeing documented... but as the use for such a feature is limited (I would say almost only for switches with two or more states) you should always be able to find 5 or maybe 10 keys to be "missused" for this purpose...

WhiteMagic commented 1 month ago

This might now be doable with the intermediate input system. However, the middle state not being a key still might cause issues, such that a plugin or a new custom action for tri-state buttons are still the best options.