New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IndexOutOfBounds in com.badlogic.gdx.controllers.desktop.ois.OisJoystick.buttonPressed #5857
Comments
Duplicate / Same Source affected: #2964 |
@Monarchis then we should probably change that issue, because i don't have any A4Tech hardware. |
@nonchip I refered to this Issue, because it also affects the same native library, that it returns wrong KeyCounts, in your case the array is also initialized with a wrong size. Currently idk if it's a problem with the Hardware or the native library itself. |
i think it's probably an issue with the library ( maybe it's also somewhat related to the driver/hardware possibly skipping button IDs or something like that (e.g. i could imagine a device reporting oh btw, looking further at that function, EDIT: Line 52 in b036f05
buttonId , which seems to be a "component" id (from said shared index space, thus possibly larger than the buttonCount ).
EDIT2:
note those button IDs being larger than the reported number of buttons, which seems to confirm the "mixed/skipped IDs" theory. pressing another bunch of keyboard and mouse buttons, it seems to be like then again no events in seems like it's doing it literally the wrong way around, trying to access devices that aren't supposed to and not even touching the one that is enabled. TL;DR: seems like the easiest solution to force your code to behave in-spec would be to use the |
@nonchip Yes that's exact the reason, why I marked it as duplicate, there are more Issues with the same Problem of the native implementation. the native code behind this Line is just wrong. This also affects other Issues: Line 241 in b036f05
That leads to a wrong size initialization at: Line 40 in b036f05
That the Exeption is thrown on Line: Line 52 in b036f05
Maybe i'll try to fix it those days, else you or someone else could also create a pr ;) |
well i don't know if the code to get the "button count" is wrong, or just you using the "count" as "max value of index". |
@nonchip I observed, that OIS, works with offsets off buttons (mappings), so may there could be also be the problem... Actually I also don't know how to fix this. |
While this still remains an issue, I have pushed a workaround in ckb-next. |
@tatokis i'm not sure ckb-next should be stripped of functionality just because libgdx isn't as quick as we might like in replacing the call to |
@nonchip It's not stripping or removing any functionality. For every physical device, it makes a virtual keyboard and a virtual mouse. All that commit does is remove the keyboard keys from the virtual mouse, which were not being used in the first place. Either way, this is off topic in this thread. |
@tatokis ok yeah just realized the |
Hi, please take a look at gdx-controllers v2 prerelease snapshot. It should solve your issue. |
see
libgdx/extensions/gdx-controllers/gdx-controllers-desktop/src/com/badlogic/gdx/controllers/desktop/ois/OisJoystick.java
Line 52 in b036f05
crashes in games like PokeMMO and (according to google) Slay the Spire (found this report when looking for the issue: https://steamcommunity.com/app/646570/discussions/1/1751232561619087220/), when tools like ckb-next (required for corsair input devices on linux) or xboxdrv are being used.
Error message I'm getting in PokeMMO:
The text was updated successfully, but these errors were encountered: