muchimi / JoystickGremlinEx

Modified version of Joystick Gremlin to add features I wanted to have but were difficult to do as just a plugin, plus I wanted to run this as 64 bit and on a more current version of Python/QT.
GNU General Public License v3.0
37 stars 6 forks source link

v3_40_14_m22 Invalid AxisName lookup #123

Closed fjdiazt closed 1 month ago

fjdiazt commented 2 months ago

v3_40_14_m22

I am trying to remap an axis to vJoy Dial

image

But I am getting:

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "gremlin\ui\ui_common.py", line 726, in _execute_callback
   File "gremlin\ui\ui_common.py", line 599, in get_selection
   File "gremlin\types.py", line 84, in to_enum
 gremlin.error.GremlinError: 'Invalid AxisName lookup, Dial (8)'

image

This works fine in JoystickGremlin

dill_debug.txt log.txt

pavelsubik commented 2 months ago

Hello, is it possible to use all axes? how?

image

Thx

muchimi commented 2 months ago

Thank you for reporting. Yes the enum refactor doesn't handle more than the first 8 axes and it looks like you have 16 total selected and vjoy is thus reporting the bottom 8 which have different names. I will address this in the next patch.

muchimi commented 2 months ago

v3_40_14_m22

I am trying to remap an axis to vJoy Dial

image

But I am getting:

During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "gremlin\ui\ui_common.py", line 726, in _execute_callback
   File "gremlin\ui\ui_common.py", line 599, in get_selection
   File "gremlin\types.py", line 84, in to_enum
 gremlin.error.GremlinError: 'Invalid AxisName lookup, Dial (8)'

image

This works fine in JoystickGremlin

dill_debug.txt log.txt

Thanks for reporting - will address in the next patch.

muchimi commented 2 months ago

I did a couple of things as I'm not able to reproduce this with the understanding every system is different. (1) beefed up the lookup code so it won't blow up if it cannot find a value - it will report the axis name as invalid but won't take the whole system down with it. This may still create an error, but it will shed some light as to why. (2) the windows API only supports up to 8 axes, 128 buttons and 4 hats. You should not select more than 8 devices in Vjoy configuration and what's happening here is the bottom 8 are duplicated for the top 8 and just report as different names, but these shouldn't matter as far as I know as only 8 will report and the names in VJOY don't really matter in GremlinEx.

Here's mapping on Dial (axis 8) using the legacy mapper.

image

muchimi commented 1 month ago

Marking resolved as of 13.40.15ex m2 (added boundary check). Direct Input devices can only have up to 8 axes, 128 buttons and 4 hats in any combination.

Festive4020 commented 1 month ago

To clarify, can we still USE the remaining options on vjoy so long as we don't select more than 8 axis (so we could have the axis show with the clearer names in software), or do we need to ONLY use the top 8 axis in vjoy? (x-dial/slider2)

muchimi commented 1 month ago

GremlinEx (and there is a similar issue reported on the original Gremlin) boils down to this: the Microsoft DirectInput specification only supports up to 8 (eight) axes on a game input device, so a single device cannot have more than 8 axes, 128 buttons and 4 hats. I don't recall if Vjoy lets you define more than that but you cannot have more than 8 axes at a time on any single VJOY device, and furthermore, each defined VJOY device must be different from the other by either axis count, button count or hat count. Can you post a screenshot of your VJOY configuration app showing the problematic device? There may be a bug in that it should not let you use more than 8 even if more than 8 are reported so I'll look into that. I do know that this error when reported in the past had to do with VJOY configurations and specs but the point is GremlinEx should handle this correctly and point out any configuration problems with the inputs.

Festive4020 commented 1 month ago

My question is not so much a bug as it is clarification.

With the newer versions of vjoy, we can select up to 8 axis, but you can choose what those axis are called to a degree. Wheel rather than say, X, or Clutch rather than say, rZ, etc...

muchimi commented 1 month ago

Currently, GremlinEx expects the default names and the first 8 names as presented. I tested ok with the registry hack, although it causes some strange behaviors as it confused DirectInput a bit (although it works). GremlinEx directly uses the information reported by the API and internally uses its own naming for axes (the API actually uses a hardware GUID and an index - no names are used). I unfortunately don't have a game that only works with a wheel and I was able to test GremlinEx ok with the hack or without so I assume one of the two methods would work here.

muchimi commented 1 month ago

I would select the first set of inputs (default) as VJOY configures them to avoid any problems.

muchimi commented 1 month ago

I am closing this issue and marking it as resolved, pending further input. We can reopen if the issue resurfaces or is not fixed completely.