Rexeh / joystick-diagrams

Automatically output your tool/game HID configs into printable diagrams with all your binds.
https://joystick-diagrams.com
GNU General Public License v2.0
146 stars 22 forks source link

Updates to Joystick Gremlin plugin #82

Open jc43081 opened 2 months ago

jc43081 commented 2 months ago
Rexeh commented 2 months ago

Hi @jc43081 I see this PR but don't believe we've spoken before?

I see you're trying to add axis support here for joystick gremlin, but the current implementation I don't believe will work.

Joystick gremlin XMLs do not expose the mappings to axis type. The only way to get this is via something like integrating DILL or parsing the debug.txt from the joystick gremlin installation which does log the correct direct device mappings.

jc43081 commented 2 months ago

Hello, no, I don't believe we have, but I am grateful for your work on this. I am the author of Joystick Gremlin SC which is extension of the EX version.

Given my work on it, I believe the axis number can be used to map to the correct axis in the diagram. For example, if I have the following mapping, the axis=1 means AXIS_X. Given it's mapping to vJoys, it should be consistent. (2=Y, 3=Z, etc.)

<remap vjoy="1" axis="1" axis-type="absolute" axis-scaling="1.0" action_id="2020533b5a994da18b59452edf4cbc86"/>

I may have this wrong so please let me know if this is not correct.

Rexeh commented 2 months ago

Hello, no, I don't believe we have, but I am grateful for your work on this. I am the author of Joystick Gremlin SC which is extension of the EX version.

Given my work on it, I believe the axis number can be used to map to the correct axis in the diagram. For example, if I have the following mapping, the axis=1 means AXIS_X. Given it's mapping to vJoys, it should be consistent. (2=Y, 3=Z, etc.)

<remap vjoy="1" axis="1" axis-type="absolute" axis-scaling="1.0" action_id="2020533b5a994da18b59452edf4cbc86"/>

I may have this wrong so please let me know if this is not correct.

Many thanks!

I've spoken with Whitemagic who maintains Joystick Gremlin who confirmed this is the case, I guess they "could" line up with the values but there is no assurance of this, which is why it hasn't been done so far. That said happy to revisit if there is something I've misunderstood given your understanding of the underlying code.

Originally I was going to integrate DILL (did some POCs with this) but overall didn't. Now that plugins are segregated it would be possible to keep this isolated to the Joystick Gremlin plugin. Parsing the debug text is the easiest (but probably most messy) but the issue here is right now the plugin system lacks multi-path support (i.e. allowing a particular plugin to require N number of file/directory selections).

Issue for this is here - https://github.com/Rexeh/joystick-diagrams/issues/46

Coincidentally, the JG plugin is undergoing a rewrite to better support the recursive nature as the today version only supports/expects "remap" blocks. Sorry if this wasn't clear, definitely welcome people extending the tool but worth reaching out on discord/discussing first to ensure no clashes with ongoing branches.

jc43081 commented 2 months ago

I am glad to contribute. I was fixing it for myself and figured others may benefit and didn't think of connecting on Discord since PRs seem to be the common way to provide these types of contributions.

Feel free to leverage it or not given the pending rewrite. It may serve as an interim solution given the hat descriptions are broken in the current version.

Rexeh commented 2 months ago

I am glad to contribute. I was fixing it for myself and figured others may benefit and didn't think of connecting on Discord since PRs seem to be the common way to provide these types of contributions.

Feel free to leverage it or not given the pending rewrite. It may serve as an interim solution given the hat descriptions are broken in the current version.

Yeah cheers, main is not currently working and is just in-between releases so that rewrite is currently not finished hence the issue but will take a look. Reason for discord is because of this, not all the branches are published and roadmap/priorities may conflict with some other core work going on.

This is primarily because it's just old me maintaining this, obviously welcome others but would prefer if that was on more of a "team" basis / collaboration.

I'll keep this PR open for the time being, and revisit when I pickup the JG rewrite and it has been covered with tests.